Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

How to identify which of the inject is failing the sling model to instantiate

Avatar

Level 1

How to identify which of the inject is failing the sling model to instantiate??

if suppose i have 5 inject annotations in my sling model and 1 of which its not able to inject. How to identify that particular 1 inject amoung 5.

Thanks

2 Replies

Avatar

Level 2

Yo have to debug the java class and chek wich of the attributes with the @Inject notation are null.

Avatar

Level 5

You need to debug the java class and check the logs to identify were sling model instantiation is failing.

To be safer side you can use optional attribute. Please follow below link.

Apache Sling :: Sling Models

Thanks,

Manjunath DJ