2 Replies Latest reply on Oct 26, 2010 1:19 PM by jnovotny

    Migration from 4.2.3 to 5.1.0 and classloading issues

    jnovotny Newbie



      I'm trying to migrate our 2 webapps to use JBoss 5.1.0 and facing classloading issues. Basically in 4.2.3 the server/default/deploy directory had the following:






      and it all worked fine.


      Now however, I get errors that foo.war can't find the classes that are in myEJB.jar. I've read http://community.jboss.org/wiki/useJBossWebClassLoaderinJBoss5 and couldn't quite figure out what I need to do. I tried placing myEJB.jar inside the WEB-INF/lib of foo.war but that still didn't work. Ideally I'd like to just maintain the same deployment structure that was used in JBoss 4.2.3. Any insight is greatly appreciated! I'm happy to post any config files I have that would be pertinent here...

        • 1. Re: Migration from 4.2.3 to 5.1.0 and classloading issues
          Wolfgang Knauf Master



          why not bundling all three archives in an EAR file?


          When doing so, you would only have to modify the "ClassPath" in the Manifest.mf files of both WAR files, and everything should be fine:


          Manifest-Version: 1.0
          Class-Path: myEJB.jar


          Best regards



          • 2. Re: Migration from 4.2.3 to 5.1.0 and classloading issues
            jnovotny Newbie

            Thanks, Wolfgang


            I tried that and it's still not working :-(


            Basically I keep getting something like the following:


              Deployment "vfszip:/Users/novotny/Software/jboss-5.1.0.GA/server/default/deploy/cis.ear/" is in error due to the following reason(s): java.lang.ClassNotFoundException: com.machenergy.session.core.AccessLevelBean from BaseClassLoader@51a5aa86{VFSClassLoaderPolicy@535e6d4a{name=vfszip:/Users/novotny/Software/jboss-5.1.0.GA/server/default/deploy/cis.ear/ domain=ClassLoaderDomain@5918cb3a{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@22998b08} roots=[MemoryContextHandler@1549352968[path= context=vfsmemory://5c4o16i-kwirzv-gfr15k2a-1-gfr1691s-2b real=vfsmemory://5c4o16i-kwirzv-gfr15k2a-1-gfr1691s-2b], DelegatingHandler@1736113301[path=cis.ear context=file:/Users/novotny/Software/jboss-5.1.0.GA/server/default/deploy/



            The class that it claims cannot be found is in my myEJB.jar as in our example (actually called backoffice2.jar). Why can't it find it?


            I have the following structure:



                      application.xml  <- here I mention the example.war and myEJB.jar


                myEJB.jar  <- this does in fact have the classes needed by the WAR file


            Thanks, Jason