ResourceResolver Session and java.lang.LinkageError: javax/jcr/Session Help | Community
Skip to main content
Level 8
October 16, 2015
Solved

ResourceResolver Session and java.lang.LinkageError: javax/jcr/Session Help

  • October 16, 2015
  • 2 replies
  • 677 views

Hey all,

I'm having some issues retrieving a session from the resourceResolver and also using the repository to log in to a session.

With the resourceResolver, i'm passing the ResourceResolver object from a JSP file over to a class file and then performing an adaptTo(Session.class).  Once this is done, the session is returned as NULL and i'm obviously unable to utilize it.  Any ideas as to why?

Since that issue came up, i switched over to using a @Component and @Service annotations and accessing the session via the SlingRepository.  Taking this approach, i get an error "java.lang.LinkageError: javax/jcr/Session Help" when i try to call a method on the session object.  Any insight to this would also be helpful.

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JustinEd3

It looks like there's something wrong with your bundle. Can you verify that you are importing the javax.jcr package and not embedding it?

2 replies

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

It looks like there's something wrong with your bundle. Can you verify that you are importing the javax.jcr package and not embedding it?

leeaslingAuthor
Level 8
October 16, 2015

I had it in my pom file, added <scope>provided</scope> to the dependency and all is now good.  Thank you!