0

Resource Resolver is being returned as null while injecting through sling models , let me know if anything i am missing :

I tried with :

@Model(adaptables = Resource.class)
public class Navigation {

   @Inject  @Source("sling-object")
   private ResourceResolver resourceResolver;

}

I also tried with:

@Model(adaptables = Resource.class)
public class Navigation {

  @Inject
  private ResourceResolver resourceResolver;

}

In both cases it was being returned as null and throwing a null pointer exception when ResourceResolver is being used .

Let me know what i may be missing to correct this error.

user3837000
  • 121
  • 3
  • 12
  • Why do you create two times the same question and not just edit the first one? – Thomas Aug 26 '15 at 11:55
  • 2
    possible duplicate of [Resource Resolver returned as null via sling models](http://stackoverflow.com/questions/32223387/resource-resolver-returned-as-null-via-sling-models) – Thomas Aug 26 '15 at 11:56
  • both are same , i forgot i posted it earlier so reposted it , let me know if any inputs you can provide for same – user3837000 Aug 26 '15 at 13:12

0 Answers0