Hi Marina,
I realized that adding the hibernate jars to the common classloader was not correct. I was trying to avoid version mismatches which I was concerned would happen if I added the hibernate jars to glassfish/lib, so I tried another approach, which was to add the hibernate jars to the classpath suffix (the Shared Chain classloader).
According to the Glassfish Developer's Guide Classloaders chapter (Table 2.1) "The Shared Chain class loader loads most of the core Application Server classes." Unfortunately, the documentation doesn't indicate which lib directory this classloader loads from. My assumption is that this classloader loads jars from glassfish/lib, so using the classpath suffix should use the same classloader as the jars in glassfish/lib (I think) yet place the application jars at a lower priority level, thus avoiding version clashes.
Looking at the log leads me to think that the problem has been partially, but not fully solved. Following are a sample of the error msgs I am now getting in the log, and below that is a full stack trace:
[b]Error Messages[/b]
7-ba96-46921d585856;|sfsb activation error. Key: 907f0100001f-62452840-18d
javax.ejb.EJBException: Couldn't create EntityManager for refName: com.unclejoes.ejb.ShoppingCartBean/em
...where ShoppingCartBean is a stateful session bean in my application.
Caused by: java.lang.ClassNotFoundException: com.unclejoes.model.CatalogItem
...where CatalogItem is an entity bean in my application.
[b]Full Stack Trace[/b]
[#|2007-10-02T17:36:45.632-0500|SEVERE|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=35;_ThreadName=Conta
inerBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[]];_RequestID=53f50d17-ad8c-4ad
7-ba96-46921d585856;|sfsb activation error. Key: 907f0100001f-62452840-18d
javax.ejb.EJBException: Couldn't create EntityManager for refName: com.unclejoes.ejb.ShoppingCartBean/em
at com.sun.ejb.containers.StatefulSessionContainer.repopulateEEMMapsInContext(StatefulSessionContainer.java:2141)
at com.sun.ejb.containers.StatefulSessionContainer.activateEJB(StatefulSessionContainer.java:2040)
at com.sun.ejb.containers.util.cache.LruSessionCache.lookupEJB(LruSessionCache.java:281)
at com.sun.ejb.containers.StatefulSessionContainer._getContext(StatefulSessionContainer.java:1211)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1675)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1229)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:195)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.jav
a:83)
at $Proxy215.destroy(Unknown Source)
at sun.reflect.GeneratedMethodAccessor4551.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
at org.jboss.seam.Component.callDestroyMethod(Component.java:1765)
at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:231)
at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:297)
at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:45)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:777)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:735)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:646)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:899)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5498)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1822)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1811)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.unclejoes.model.CatalogItem
at com.sun.appserv.server.util.ASURLClassLoader.loadClass(ASURLClassLoader.java:129)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.hibernate.engine.StatefulPersistenceContext.deserialize(StatefulPersistenceContext.java:1283)
at org.hibernate.impl.SessionImpl.readObject(SessionImpl.java:1899)
at sun.reflect.GeneratedMethodAccessor4553.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at com.sun.ejb.containers.StatefulSessionContainer.repopulateEEMMapsInContext(StatefulSessionContainer.java:2133)
... 26 more
|#]
[#|2007-10-02T17:36:45.634-0500|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=35;_ThreadName=Contain
erBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[]];ShoppingCartBean;|EJB5018: An
exception was thrown during an ejb invocation on [ShoppingCartBean]|#]
[#|2007-10-02T17:36:45.634-0500|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=35;_ThreadName=Contain
erBackgroundProcessor[StandardEngine[com.sun.appserv].StandardHost[server].StandardContext[]];|
javax.ejb.NoSuchObjectLocalException: The EJB does not exist. session-key: 907f0100001f-62452840-18d
at com.sun.ejb.containers.StatefulSessionContainer._getContext(StatefulSessionContainer.java:1220)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1675)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1229)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:195)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.jav
a:83)
at $Proxy215.destroy(Unknown Source)
at sun.reflect.GeneratedMethodAccessor4551.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
at org.jboss.seam.Component.callDestroyMethod(Component.java:1765)
at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:231)
at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:297)
at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:45)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:777)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:735)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:646)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:899)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5498)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1822)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1811)
at java.lang.Thread.run(Thread.java:619)
|#]
Thanks,
Rick
[Message sent by forum member 'rickhoro' (rickhoro)]
http://forums.java.net/jive/thread.jspa?messageID=238166