javatoplinktoplink-essentials

Error While acquiring Client session in TopLink


I am facing a peculiar issue. Below is the stack trace of what error i am getting.Please help.

Exception [TOPLINK-7001] (Oracle TopLink - 11g Release 1 (11.1.1.1.0) (Build 090527)): oracle.toplink.exceptions.ValidationException
Exception Description: You must login to the ServerSession before acquiring ClientSessions.
 at oracle.toplink.exceptions.ValidationException.loginBeforeAllocatingClientSessions(ValidationException.java:1155)
 at oracle.toplink.threetier.ServerSession.acquireClientSession(ServerSession.java:313)
 at oracle.toplink.threetier.ServerSession.acquireClientSession(ServerSession.java:303)
 at com.ofss.elcm.domain.Session.fetchClientSession(Session.java:113)
 at com.ofss.elcm.domain.Session.acquireUnitOfWork(Session.java:132)

Solution

  • EclipseLink has the facility to check for classloader changes in cases of application redeployment. This can cause issues when calling into the SessionManager for a particular session from both a Web container and a EJB container.

    Ensure that you are using the API getSession(null, sessionName, classLoader, true, false) or the same method with the longer signature to disable this classLoader checking. If you wish to construct a XMLSessionConfigLoader directly you can disable the classloader checking directly though xmlSessionConfigLoader.setShouldCheckClassLoader(false).