7 Replies Latest reply on Jul 17, 2006 10:26 AM by beugeair

    [URGENT] Classloading issue

    beugeair

      Hello all,

      I'm experiencing trouble with jboss class loading mechanism.

      My J2EE application structure :

      WebApp[jar in /WEB-INF/lib] <==> Ear[ejb-jar in /, jar in /APP-INF/lib]

      I try JBoss 4.0.3SP1 and 4.0.4 with same exception.

      Struts actions in the webApp call some Facade EJB which delegate call to other Worker EJB. All the Facade EJB are in one ejb-jar module inside the EAR bundle, each Worker EJB are in one ejb-jar module inside the EAR bundle

      Scenario :

      When I'm calling one action, all is fine, but when I'm calling another action, I get this exception :

       java.lang.ClassNotFoundException: No ClassLoaders found for: si3si.metier.quartierforce.client.vo.VoAdrEml
       at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
       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:242)
       at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:574)
       at org.jboss.invocation.MarshalledValueInputStream.resolveClass(MarshalledValueInputStream.java:109)
       at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
       at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
       at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1585)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at org.jboss.invocation.MarshalledValue.get(MarshalledValue.java:91)
       at org.jboss.invocation.InvokerInterceptor.invokeLocalMarshalled(InvokerInterceptor.java:294)
       at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:61)
       at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
       at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
       ... 47 more
      


      The class si3si.metier.quartierforce.client.vo.VoAdrEml appears one and only one time in one ejb-jar insde the ear and also one and only one time inside the webApp.
      I've been looking after the best JBoss class loading strategy, I finally use the isolated one, the webApp and the ear are isolated and the CallByValue is enabled.

      The classpath of the webApp seems to be good, the ear classpath too.

      I can't understand why it works in another way and not in taht way ...

      Please help !


        • 2. Re: [URGENT] Classloading issue
          beugeair

          thx,

          I've seen the first two link with no results, but the logging tell this :

          [...]
          [2098372,RepositoryClassLoader,http-0.0.0.0-8080-3] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@5a3923{ url=file:/D:/gwallet/tools/j2ee/jboss-4.0.3SP1/server/default/tmp/deploy/tmp23128jboss-service.xml ,addedOrder=2} name=si3si.metier.quartierforce.client.vo.VoAdrEml
          [2098372,RepositoryClassLoader,http-0.0.0.0-8080-3] findClass, name=si3si.metier.quartierforce.client.vo.VoAdrEml
          [2098388,RepositoryClassLoader,http-0.0.0.0-8080-3] CFNE: Adding to blacklist: si3si.metier.quartierforce.client.vo.VoAdrEml
          [2098388,RepositoryClassLoader,http-0.0.0.0-8080-3] CFNE: Adding to blacklist: si3si.metier.quartierforce.client.vo.VoAdrEml
          [2098388,RepositoryClassLoader,http-0.0.0.0-8080-3] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@5a3923{ url=file:/D:/gwallet/tools/j2ee/jboss-4.0.3SP1/server/default/tmp/deploy/tmp23128jboss-service.xml ,addedOrder=2} name=si3si.metier.quartierforce.client.vo.VoAdrEml not found
          


          The classloader is blacklisting the class because it don't find it inside the webapp, but the class IS INSIDE THE WEBAPP ?

          Don't understand ...


          • 3. Re: [URGENT] Classloading issue
            jaikiran

             

            but the class IS INSIDE THE WEBAPP


            Run the following command from the prompt and post your output:

            jar -tf yourApp.ear


            or

            jar -tf yourApp.war


            This will display the contents and the directory structure of your application.



            • 4. Re: [URGENT] Classloading issue
              beugeair

              So I use this commande :

              > jar -tf force-webapp-vpt-020708.war
              [...]
              WEB-INF/lib/force-quartier-facturation-020708.jarWEB-INF/lib/force-quartier-force-020708.jarWEB-INF/lib/force-quartier-livraison-020708.jar
              [...]
              


              It display all the content of the webapp, the VoAdrEml isn't inside WEB-INF/classes because it is inside the ejb-client-jar ...
              WEB-INF/lib/force-quartier-force-020708.jar

              ... which appear in the webApp content.

              I remember that the webapp is class loader isolated.

              I don't understand why jboss can't find this class but load successfully the VoPdv class which is in the same WEB-INF/lib/force-quartier-force-020708.jar.


              • 5. Re: [URGENT] Classloading issue
                beugeair

                Hello,

                I try to enable the jar index capabilites in order to give to Jboss the INDEX.LIST inside every generated bundle to :
                - accelerate the class loading ...
                - and upgrade the accuracy of JBoss class loader ...

                But it doesn't work anymore

                Still investigating ...

                • 6. Re: [URGENT] Classloading issue
                  beugeair

                  Hi,

                  I don't take care about this, but now I think it's important !

                  The classloader is looking for the class :

                  si3si.metier.quartierforce.client.vo.VoAdrEml

                  and
                  si3si.metier.quartierforce.client.vo.VoAdrEmlBeanInfo

                  which doesn't appears anywhere inside de source code, is one library generating java code at runtime (*BeanInfo.java) ?

                  A begining of explanation :
                  A *BeanInfo class is generated during the busyness execution os when the Vo is given to the WebApp, it want to unserialize a class (Vo*BeanInfo) which isn't in the classpath ... but the question is WHO is doing the code generation !

                  Still investigating ...

                  • 7. [1/2 SOLVED] [URGENT] Classloading issue
                    beugeair

                    Hello,

                    I have found a solution that I can not explain :
                    In the tomcat sar / WEB-INF / jboss-service.xml
                    I put the UseJbossWebLoader on to enable the use of JBoss classloading in place of Tomcat Class loading ... I think.

                    <!-- A flag indicating if the JBoss Loader should be used. This loader
                     uses a unified class loader as the class loader rather than the tomcat
                     specific class loader.
                     The default is false to ensure that wars have isolated class loading
                     for duplicate jars and jsp files.
                    -->
                    <attribute name="UseJBossWebLoader">true</attribute>
                    <!-- attribute name="UseJBossWebLoader">false</attribute -->
                    


                    If someone can give an logical explaination to this kind of issue, please tell me !

                    Investigation aborted !
                    Target aquired !