4 Replies Latest reply on Nov 18, 2008 6:14 AM by yairogen

    java.lang.NoClassDefFoundError for jars that are in the EarC

    yairogen

      Hi,

      I get java.lang.NoClassDefFoundError even though my jars aer in the EAR under the EarContent folder and I checked them in the "" tab in my EJB project.

      Can some one please help my only putting the jars explicitly in the deploy folder does JBoss find it?

      I am using version: 4.2.3.

        • 1. Re: java.lang.NoClassDefFoundError for jars that are in the
          jaikiran

          Please provide more details about your application packaging. Where are the jar files located in the EAR? Post the output of

          jar -tf myApp.ear


          where myApp.ear is the name of your EAR file.

          Do you use an IDE for packaging/deploying the application?

          While posting the logs or xml content or code, remember to wrap it in a code block using the Code button in the message editor window and please hit the Preview button to make sure your post is correctly formatted

          • 2. Re: java.lang.NoClassDefFoundError for jars that are in the
            yairogen

            Hi,

            Thanks for your repy.

            This is the output of the command:


            META-INF/
            META-INF/MANIFEST.MF
            META-INF/application.xml
            META-INF/jboss-app.xml
            META-INF/spring-loader-service.xml
            cablogging-1.1.0.0.jar
            cablogging-commons-1.1.0.0.jar
            cablogging-slf4j-1.1.0.0.jar
            common-utils-1.0.13.jar
            commons-configuration-1.4.jar
            conmgr-monitor-ifc-1.0.1.jar
            conmgr-monitor-impl-1.0.3.jar
            conmgrIfcEjb_jdk5.jar
            conmgrImplEjb_jdk5.jar
            dbtrxinfra-0.0.2.jar
            emm-server-ifc-2.1.0.3.jar
            emm-server-impl-2.1.0.5.jar
            ibatis2-2.3.0.677.jar
            infra-0.2-20081022.122024-4.jar
            ojdbc-5.jar
            spring-2.5.jar
            xerces-1.2.3.jar
            


            I use eclipse 3.4 for the wrapping of the EAR. all the jars are located physically under a folder called EarContent.



            • 3. Re: java.lang.NoClassDefFoundError for jars that are in the
              jaikiran

              Create a folder named "lib" at the EAR root and place these jars inside that lib folder:

              myapp.ear
              |
              |--- META-INF
              | |
              | |--- application.xml
              | |
              | |--- [other appropriate files]
              |
              |--- lib
              | |
              | |--- *.jar (the utility jar files)
              |
              


              • 4. Re: java.lang.NoClassDefFoundError for jars that are in the
                yairogen


                Thanks.

                Looks like this solved the problem.