4

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)
bakkal
  • 54,350
  • 12
  • 131
  • 107
M.J.
  • 16,266
  • 28
  • 75
  • 97
  • Are there any other errors during deployment? Have you called ServerSession.login() ? Are you creating the ServerSession using the SessionManager? – Gordon Yorke Jul 30 '10 at 18:54
  • @Gordon hi.. this error comes only when i try to use the same class through different class loaders.. like.. in am application i use both servlet and EJB.. so the code works absolutely fine if i use one of them.. either servlet or EJB.. but when i try to use both simultaneouly, if get this error.. i feel this can be the issue of class loaders.. as servlet has its own class loaders and EJB has its own.. – M.J. Aug 02 '10 at 09:28
  • adding to the above comment.. i am using session manager to create server session.. – M.J. Aug 02 '10 at 09:29

2 Answers2

1

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).

Gordon Yorke
  • 1,996
  • 11
  • 7
0

Did you try using the sessionmanager from a singleton object? That way, you should always get the same manager-instance and there should be no classloader-issues.

Kurt Du Bois
  • 7,550
  • 4
  • 25
  • 33