0 Replies Latest reply on Jan 18, 2012 9:03 PM by kern.augusto

    ClassNotFoundException: org.hibernate.ejb.EntityManagerImpl

    kern.augusto

      Im using glassfish 3.1.1 with hibernate 3.5.6 and i have this stack  below, when  the application is about to activate Statefull Session Bean. I tryed to put hibernate libs into domain-dir/lib as follow www.java.net/node/669869 but not solved my problem.

      Any sugestions?

      [#|2012-01-18T15:59:38.291-0200|SEVERE|glassfish3.1.1|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=34;_ThreadName=Thread-2;|EJB5128:Error  during Stateful Session Bean activation for key  [9009cc00001f-fffffffff1dcbf6d-4]|#]

      [#|2012-01-18T15:59:38.292-0200|SEVERE|glassfish3.1.1|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=34;_ThreadName=Thread-2;|
      javax.ejb.EJBException: Couldn't create EntityManager for refName: br.com.xyz.rooms.dao.impl.GenericHibernateDao/em
          at com.sun.ejb.containers.StatefulSessionContainer.repopulateEEMMapsInContext(StatefulSessionContainer.java:2483)
          at com.sun.ejb.containers.StatefulSessionContainer.activateEJB(StatefulSessionContainer.java:2383)
          at com.sun.ejb.containers.util.cache.LruSessionCache.lookupEJB(LruSessionCache.java:275)
          at com.sun.ejb.containers.StatefulSessionContainer._getContext(StatefulSessionContainer.java:1416)
          at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2528)
          at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1895)
          at com.sun.ejb.containers.StatefulSessionContainer.removeBean(StatefulSessionContainer.java:968)
          at com.sun.ejb.containers.EJBLocalObjectImpl.remove(EJBLocalObjectImpl.java:187)
          at com.sun.ejb.containers.EjbContainerServicesImpl.remove(EjbContainerServicesImpl.java:154)
          at org.glassfish.weld.ejb.SessionObjectReferenceImpl.remove(SessionObjectReferenceImpl.java:69)
          at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:107)
          at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62)
          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
           at  br.com.xyz.rooms.dao.impl.org$jboss$weld$bean-advrooms-SessionBean-genericHibernateDao_$$_WeldProxy.destroy(org$jboss$weld$bean-advrooms-SessionBean-genericHibernateDao_$$_WeldProxy.java)
          at org.jboss.weld.bean.SessionBean.destroy(SessionBean.java:387)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
          at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:90)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:354)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
          at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:90)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:354)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
          at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:90)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:354)
          at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.BeanStorage.resetStorage(BeanStorage.java:99)
           at  org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultConversation.endConversation(DefaultConversation.java:129)
          at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultConversation.close(DefaultConversation.java:122)
           at  org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultWindowContextManager.closeAllWindowContexts(DefaultWindowContextManager.java:395)
           at  org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.EditableWindowContextManagerProxy.preDestroy(EditableWindowContextManagerProxy.java:89)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:193)
          at org.jboss.weld.bean.AbstractClassBean.defaultPreDestroy(AbstractClassBean.java:572)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.preDestroy(ManagedBean.java:212)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:353)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:155)
          at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:172)
          at org.jboss.weld.context.AbstractManagedContext.deactivate(AbstractManagedContext.java:50)
          at org.jboss.weld.context.AbstractBoundContext.deactivate(AbstractBoundContext.java:82)
          at org.jboss.weld.context.http.HttpSessionContextImpl.destroy(HttpSessionContextImpl.java:79)
          at org.jboss.weld.servlet.WeldListener.sessionDestroyed(WeldListener.java:97)
          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:807)
          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:769)
          at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:686)
          at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:998)
          at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5779)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1791)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1780)
          at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.ClassNotFoundException: org.hibernate.ejb.EntityManagerImpl
          at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
          at org.apache.felix.framework.ModuleImpl.doImplicitBootDelegation(ModuleImpl.java:1535)
          at org.apache.felix.framework.ModuleImpl.searchDynamicImports(ModuleImpl.java:1472)
          at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:734)
          at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
          at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:247)
          at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)
          at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
          at com.sun.ejb.containers.StatefulSessionContainer.repopulateEEMMapsInContext(StatefulSessionContainer.java:2475)
          ... 58 more
      |#]

      [#|2012-01-18T15:59:38.297-0200|WARNING|glassfish3.1.1|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=34;_ThreadName=Thread-2;|A  system exception occurred during an invocation on EJB  genericHibernateDao method null
      javax.ejb.NoSuchObjectLocalException: The EJB does not exist. session-key: 9009cc00001f-fffffffff1dcbf6d-4
          at com.sun.ejb.containers.StatefulSessionContainer._getContext(StatefulSessionContainer.java:1425)
          at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2528)
          at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1895)
          at com.sun.ejb.containers.StatefulSessionContainer.removeBean(StatefulSessionContainer.java:968)
          at com.sun.ejb.containers.EJBLocalObjectImpl.remove(EJBLocalObjectImpl.java:187)
          at com.sun.ejb.containers.EjbContainerServicesImpl.remove(EjbContainerServicesImpl.java:154)
          at org.glassfish.weld.ejb.SessionObjectReferenceImpl.remove(SessionObjectReferenceImpl.java:69)
          at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:107)
          at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62)
          at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
           at  br.com.xyz.rooms.dao.impl.org$jboss$weld$bean-advrooms-SessionBean-genericHibernateDao_$$_WeldProxy.destroy(org$jboss$weld$bean-advrooms-SessionBean-genericHibernateDao_$$_WeldProxy.java)
          at org.jboss.weld.bean.SessionBean.destroy(SessionBean.java:387)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
          at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:90)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:354)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
          at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:90)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:354)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
          at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:90)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:354)
          at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.BeanStorage.resetStorage(BeanStorage.java:99)
           at  org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultConversation.endConversation(DefaultConversation.java:129)
          at org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultConversation.close(DefaultConversation.java:122)
           at  org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.DefaultWindowContextManager.closeAllWindowContexts(DefaultWindowContextManager.java:395)
           at  org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.EditableWindowContextManagerProxy.preDestroy(EditableWindowContextManagerProxy.java:89)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
          at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
          at org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:193)
          at org.jboss.weld.bean.AbstractClassBean.defaultPreDestroy(AbstractClassBean.java:572)
          at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.preDestroy(ManagedBean.java:212)
          at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:353)
          at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:34)
          at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:155)
          at org.jboss.weld.context.AbstractContext.destroy(AbstractContext.java:172)
          at org.jboss.weld.context.AbstractManagedContext.deactivate(AbstractManagedContext.java:50)
          at org.jboss.weld.context.AbstractBoundContext.deactivate(AbstractBoundContext.java:82)
          at org.jboss.weld.context.http.HttpSessionContextImpl.destroy(HttpSessionContextImpl.java:79)
          at org.jboss.weld.servlet.WeldListener.sessionDestroyed(WeldListener.java:97)
          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:807)
          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:769)
          at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:686)
          at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:998)
          at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5779)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1791)
          at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1780)
          at java.lang.Thread.run(Thread.java:662)