5 Replies Latest reply on Jun 20, 2013 3:43 AM by H. C.F.

    App Migration from 4.x to 7 - Class Not Found

    H. C.F. Newbie

      I'm trying to deploy a EJB Project from a old release 4.x into the new 7.1.1.

       

      My EJB Project called myApp.jar contains inside a lib called myLib.jar.

       

      This work ok in the 4.x, however in the 7.1.1 I got the

       

      Caused by: java.lang.NoClassDefFoundError: com/app/MyLibCass

                at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_43]

                at java.lang.Class.privateGetDeclaredFields(Class.java:2300) [rt.jar:1.6.0_43]

                at java.lang.Class.getDeclaredFields(Class.java:1745) [rt.jar:1.6.0_43]

                at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                ... 10 more

      Caused by: java.lang.ClassNotFoundException: com/app/MyLibCass from [Module "deployment.myApp.jar:main" from Service Module Loader]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                ... 15 more

       

      Basically in the 7.1.1 the application can not find the Classes from the lib.

       

      How to solve this problem?

       

      After google it I found some pages that says to create a module with the myLib.jar. I tried this, but I don't know how to reference the module from a EJB project (jar file)

       

      Thanks for the help

        • 1. Re: App Migration from 4.x to 7 - Class Not Found
          Tomaz Cerar Master

          Hi,

           

          how can jar contain a jar? that sounds bit wrong.

           

           

          can you post output of jar tf <name-of-your-deployment>

           

          so we can see what are you trying to deploy.

           

           

          --

          tomaz

          • 2. Re: App Migration from 4.x to 7 - Class Not Found
            H. C.F. Newbie

            com/company/spt/server/dto/TFile.class

            com/company/spt/server/dto/TFileHistory.class

            com/company/spt/server/dto/TFileLock.class

            com/company/spt/server/dto/TFileUser.class

            com/company/spt/server/dto/TLabel.class

            com/company/spt/server/dto/TPermission.class

            com/company/spt/server/dto/TUser.class

            com/company/spt/server/dto/TUserGroup.class

            com/company/spt/server/dto/UserGroupImpl.class

            com/company/spt/server/dto/UserImpl.class

            com/company/spt/server/exceptions/

            com/company/spt/server/license/

            com/company/spt/server/license/Constants.class

            com/company/spt/server/util/

            com/company/spt/server/util/AccessServer.class

            com/company/spt/server/util/PasswordUtils.class

            com/company/spt/server/util/PasswordValidator.class

            com/company/spt/server/util/PasswordVerifier.class

            com/company/spt/server/util/RandPass$1.class

            com/company/spt/server/util/RandPass$Requirement.class

            com/company/spt/server/util/RandPass.class

            com/company/spt/server/util/ServerConfiguration.class

            com/company/spt/server/util/SystemException.class

            com/company/spt/server/util/UserIdValidator.class

            com/company/spt/server/util/UtilHelper.class

            META-INF/

            META-INF/MANIFEST.MF

            META-INF/persistence.xml

            myJarWithOtherClass.jar

            • 3. Re: App Migration from 4.x to 7 - Class Not Found
              Wolf-Dieter Fink Master

              From JavaEE perspective it sounds wrong. You need to have an ear file which can contain different jar's.

               

              BTW, to add a dependency to a module you can add "Dependencies: my.module" to the MANIFEST or use jboss-deployment-structure.xml, see here

              • 4. Re: App Migration from 4.x to 7 - Class Not Found
                Stephen Coy Master

                Your "EJB" project does not seem to contain any EJBs (and there is no ejb-jar.xml file, which I'd expect to see in JBossAS 4 app). How is the rest of your application bundled?

                • 5. Re: App Migration from 4.x to 7 - Class Not Found
                  H. C.F. Newbie

                  My Jboss4 is customized and I have EJB3.0 in it.

                   

                  I have other ejbmodules that access this ejbModule via remote interfaces.

                   

                  I dont have any ear in the 4.0, but yes, I can package now in a ear.