3 Replies Latest reply on Mar 10, 2008 7:13 PM by Jay Balunas

    Really Strange ClassNotFoundException on WL 9.2

    Neil C Novice

      When I deploy my Seam-JPA application onto WebLogic 9.2, I get the following exception:



           [exec] <Mar 10, 2008 1:12:45 PM EDT> <Error> <J2EE Deployment SPI> <BEA-260
      125> <Errors detected attempting to communicate with admin server: java.rmi.Unma
      rshalException: failed to unmarshal class java.lang.Object; nested exception is:
      
           [exec]     java.lang.ClassNotFoundException: Failed to load class org.hiber
      nate.HibernateException
           [exec] weblogic.management.jmx.RemoteRuntimeException: java.rmi.UnmarshalEx
      ception: failed to unmarshal class java.lang.Object; nested exception is:
           [exec]     java.lang.ClassNotFoundException: Failed to load class org.hiber
      nate.HibernateException
           [exec]     at weblogic.management.jmx.MBeanServerInvocationHandler.checkThr
      owsIOException(MBeanServerInvocationHandler.java:568)
           [exec]     at weblogic.management.jmx.MBeanServerInvocationHandler.invoke(M
      BeanServerInvocationHandler.java:384)
           [exec]     at $Proxy16.getTargets()[Lweblogic.management.deploy.TargetStatu
      s;(Unknown Source)
           [exec]     at weblogic.deploy.api.spi.status.ProgressObjectImpl.updateTmids
      (ProgressObjectImpl.java:166)
           [exec]     at weblogic.deploy.api.spi.status.ProgressObjectImpl.getResultTa
      rgetModuleIDs(ProgressObjectImpl.java:158)
           [exec]     at weblogic.deploy.api.spi.status.ProgressObjectImpl.reportEvent
      (ProgressObjectImpl.java:334)
           [exec]     at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl$
      TaskPoller.poll(ServerConnectionImpl.java:1067)
           [exec]     at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl$
      TaskPoller.run(ServerConnectionImpl.java:1032)
           [exec] java.rmi.UnmarshalException: failed to unmarshal class java.lang.Obj
      ect; nested exception is:
           [exec]     java.lang.ClassNotFoundException: Failed to load class org.hiber
      nate.HibernateException
           [exec]     at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:
      205)
           [exec]     at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.ja
      va:224)
           [exec]     at javax.management.remote.rmi.RMIConnectionImpl_921_WLStub.getA
      ttribute(Ljavax.management.ObjectName;Ljava.lang.String;Ljavax.security.auth.Sub
      ject;)Ljava.lang.Object;(Unknown Source)
           [exec]     at weblogic.management.remote.common.RMIConnectionWrapper$11.run
      (ClientProviderBase.java:498)
           [exec]     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Auth
      enticatedSubject.java:363)
           [exec]     at weblogic.security.service.SecurityManager.runAs(SecurityManag
      er.java:147)
           [exec]     at weblogic.security.Security.runAs(Security.java:61)
           [exec]     at weblogic.management.remote.common.RMIConnectionWrapper.getAtt
      ribute(ClientProviderBase.java:496)
           [exec]     at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerCon
      nection.getAttribute(RMIConnector.java:854)
           [exec]     at javax.management.MBeanServerInvocationHandler.invoke(MBeanSer
      verInvocationHandler.java:175)
           [exec]     at weblogic.management.jmx.MBeanServerInvocationHandler.doInvoke
      (MBeanServerInvocationHandler.java:503)
           [exec]     at weblogic.management.jmx.MBeanServerInvocationHandler.invoke(M
      BeanServerInvocationHandler.java:380)
           [exec]     at $Proxy16.getTargets()[Lweblogic.management.deploy.TargetStatu
      s;(Unknown Source)
           [exec]     at weblogic.deploy.api.spi.status.ProgressObjectImpl.updateTmids
      (ProgressObjectImpl.java:166)
           [exec]     at weblogic.deploy.api.spi.status.ProgressObjectImpl.getResultTa
      rgetModuleIDs(ProgressObjectImpl.java:158)
           [exec]     at weblogic.deploy.api.spi.status.ProgressObjectImpl.reportEvent
      (ProgressObjectImpl.java:334)
           [exec]     at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl$
      TaskPoller.poll(ServerConnectionImpl.java:1067)
           [exec]     at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl$
      TaskPoller.run(ServerConnectionImpl.java:1032)
           [exec] java.lang.ClassNotFoundException: Failed to load class org.hibernate
      .HibernateException
           [exec]     at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMICl
      assLoaderDelegate.java:203)
           [exec]     at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMICl
      assLoaderDelegate.java:128)
           [exec]     at weblogic.rmi.utils.Utilities.loadClass(Utilities.java:308)
           [exec]     at weblogic.rjvm.MsgAbbrevInputStream.resolveClass(MsgAbbrevInpu
      tStream.java:400)
           [exec]     at weblogic.utils.io.ChunkedObjectInputStream$NestedObjectInputS
      tream.resolveClass(ChunkedObjectInputStream.java:255)
           [exec]     at java.io.ObjectInputStream.readNonProxyDesc(Z)Ljava.io.ObjectS
      treamClass;(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readClassDesc(Z)Ljava.io.ObjectStre
      amClass;(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Obj
      ect;(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Un
      known Source)
           [exec]     at java.io.ObjectInputStream.defaultReadFields(Ljava.lang.Object
      ;Ljava.io.ObjectStreamClass;)V(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Lj
      ava.io.ObjectStreamClass;)V(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Obj
      ect;(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Un
      known Source)
           [exec]     at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unkn
      own Source)
           [exec]     at java.util.ArrayList.readObject(ArrayList.java:591)
           [exec]     at java.lang.LangAccessImpl.readObject(Ljava.lang.Class;Ljava.la
      ng.Object;Ljava.io.ObjectInputStream;)V(Unknown Source)
           [exec]     at java.io.ObjectStreamClass.invokeReadObject(Ljava.lang.Object;
      Ljava.io.ObjectInputStream;)V(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Lj
      ava.io.ObjectStreamClass;)V(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Obj
      ect;(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Un
      known Source)
           [exec]     at java.io.ObjectInputStream.defaultReadFields(Ljava.lang.Object
      ;Ljava.io.ObjectStreamClass;)V(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readSerialData(Ljava.lang.Object;Lj
      ava.io.ObjectStreamClass;)V(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Obj
      ect;(Unknown Source)
           [exec]     at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Un
      known Source)
           [exec]     at java.io.ObjectInputStream.readArray(Z)Ljava.lang.Object;(Unkn
      own Source)
           [exec]     at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Un
      known Source)
           [exec]     at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unkn
      own Source)
           [exec]     at weblogic.utils.io.ChunkedObjectInputStream.readObject(Chunked
      ObjectInputStream.java:195)
           [exec]     at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputS
      tream.java:565)
           [exec]     at weblogic.utils.io.ChunkedObjectInputStream.readObject(Chunked
      ObjectInputStream.java:191)
           [exec]     at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
           [exec]     at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:
      201)



      Now I assure you hibernate.jar with its org.hibernate.HibernateException is included in my WAR file.


      The really interesting thing is this: this inability to deploy only occurs when I set my join relationships to be EAGER rather than LAZY. 


      Weird, huh?


      Any insight into why this might be is appreciated.


      Thanks.

        • 1. Re: Really Strange ClassNotFoundException on WL 9.2
          Jay Balunas Novice

          Just for info, what version of seam are using?


          Also are you using the JPA example for 9.2?  Including using Pointbase?


          Do you see any other JDBC/DB errors on the server?  Check the server and pointbase logs.  I'm not a hibernate expert- but I would guess you are throwing an exception when EAGER is used and hibernate can't throw it back to you.  i.e. this might be a side effect of the real issue.


          -Jay

          • 2. Re: Really Strange ClassNotFoundException on WL 9.2
            Neil C Novice

            I am using Seam 2.0 GA.


            I had the same idea, and it turns out you were right. 


            Here is the real cause:



            org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
                 at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:66)
                 at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:75)
                 at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:43)
                 at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:33)
                 at org.hibernate.loader.entity.BatchingEntityLoader.createBatchingEntityLoader(BatchingEntityLoader.java:103)
                 at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1748)
                 at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1752)
                 at org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:2984)
                 at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:2977)
                 at org.hibernate.persister.entity.SingleTableEntityPersister.postInstantiate(SingleTableEntityPersister.java:690)
                 at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:290)
                 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
                 at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
                 at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
                 at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
                 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
                 at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
                 at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:81)
                 at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
                 at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
                 at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                 at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
                 at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
                 at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
                 at org.jboss.seam.Component.newInstance(Component.java:1968)
                 at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
                 at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
                 at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)




            Since there are like 97 log files you have to peruse with WL deployment to find what you need, I missed this the first time around. 


            I have two OneToMany relationships mapped with a List<T> data structure, and when I set things to EAGER, I get that exception.


            I have seen some resolutions involving Hibernate annotations, but I am using JPA.  Granted I am using JPA powered by Hibernate, but I would like to resolve this issue in a JPA manner rather than a Hibernate manner if possible.


            I would prefer to use a List, but would SortedSet work?


            Any insight is appreciated.


            Thanks.

            • 3. Re: Really Strange ClassNotFoundException on WL 9.2
              Jay Balunas Novice

              We I'm glad that you found the base cause of the issue, but one of the hibernate guys will have to answer your other questions.


              I'm not quite sure :)