4 Replies Latest reply on Nov 9, 2010 9:36 AM by rnit

    ClassNotFoundException though having class deployed

    ahachmann

      Hello,

      I am currently having a Classloading issue, which drives my crazy.

      I am deploying an skinny war within an ear, that contains all jars that the war needs. Further more, I am having the manifest within the war filled with the classpath containing all jars.

      Now when I deploy the application, I am receivning an ClassDeffNotFound Exception for org.aspectj.lang.JoinPoint, which is contained within the aspectjweaver.jar which is in the ear, and mentioned in the classpath.

      When analyzing the classloader logging on that exception,

      I can see, that there are several DelegatingHandlers for those jars

       

      DelegatingHandler@520671934[path=Vanille-Shop_EAR.ear/commons-collections-3.1.jar context=file:/Applications/jboss-5.1.0.GA/server/default/deploy/ real=file:/Applications/jboss-5.1.0.GA/server/default/deploy/Vanille-Shop_EAR.ear/commons-collections-3.1.jar],

       

      But the one for aspectjweaver.jar is missing. Actually there are several entries missing.

       

      Is there something I am missing? What can be the reason for those entries being missed.

       

      I'd be happy for every hint.

       

      Best Regards,

      Alexander

        • 1. Re: ClassNotFoundException though having class deployed
          wdfink

          Can you post EAR structure and the deployment descriptors?

          • 2. Re: ClassNotFoundException though having class deployed
            ahachmann

            Hello,

             

             

            The War does not contain anything within MEAT-INF/lib as I excluded all jars from there and want to load them

             

            from the EAR. So all EJB Jars and Thirdparty Libraries are placed in the root of the ear. This works fine as I can see

             

            that the Springcontext is being laoded. So Spring is reachable. Only AspectJWeaver makes Trouble

             

            The Manifest is this:

            Manifest-Version: 1.0

            Class-Path: antlr-2.7.6.jar

            antlr-runtime-3.1.1.jar

            aopalliance-1.0.jar

            asm-3.1.jar

            aspectjweaver-1.6.8.jar

            cglib-2.2.jar

            commons-beanutils-1.8.0.jar

            commons-collections-3.1.jar

            commons-digester-1.8.1.jar

            commons-lang-2.4.jar

            core-3.4.2.v_883_R34x.jar

            dom4j-1.6.1.jar

            domainvalues.jar

            dozer-5.2.0.jar

            drools-api-5.0.1.jar

            drools-compiler-5.0.1.jar

            drools-core-5.0.1.jar

            hibernate-core-3.3.1.GA.jar

            janino-2.5.15.jar

            joda-time-1.6.jar

            jsf-facelets-1.1.15.B1.jar

            jta-1.1.jar

            mvel2-2.0.10.jar

            richfaces-api-3.3.2.SR1.jar

            richfaces-impl-3.3.2.SR1.jar

            richfaces-ui-3.3.2.SR1.jar

            slf4j-api-1.5.2.jar

            spring-aop-2.5.6.SEC01.jar

            spring-beans-2.5.6.SEC01.jar

            spring-context-2.5.6.SEC01.jar

            spring-core-2.5.6.SEC01.jar

            spring-jdbc-2.5.6.SEC01.jar

            spring-tx-2.5.6.SEC01.jar

            spring-web-2.5.6.SEC01.jar

            Vanille-Shop_Entities.jar

            Vanille-Shop_Services.jar

            xpp3_min-1.1.4c.jar

             

            The application.xml:

            <?xml version="1.0" encoding="ASCII"?>

            <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">

              <display-name>Vanille-Shop_EAR</display-name>

              <module>

                <web>

                  <web-uri>Vanille-Shop_Presentation.war</web-uri>

                  <context-root>Vanille-Shop_EAR</context-root>

                </web>

              </module>

              <module>

                <ejb>Vanille-Shop_Entities.jar</ejb>

              </module>

              <module>

                <ejb>Vanille-Shop_Services.jar</ejb>

              </module>

            </application>

             

             


            This is the content of the EAR.

            [INFO] ------------------------------------------------------------------------

            [INFO] Building Unnamed - de.vanille-shop:Vanille-Shop_EAR:ear:0.0.1-SNAPSHOT 0.0.1-SNAPSHOT

            [INFO] ------------------------------------------------------------------------

            [INFO]

            [INFO] --- maven-dependency-plugin:2.0:tree (default-cli) @ Vanille-Shop_EAR ---

            [INFO] de.vanille-shop:Vanille-Shop_EAR:ear:0.0.1-SNAPSHOT

            [INFO] +- de.vanille-shop:Vanille-Shop_Presentation:war:0.0.1-SNAPSHOT:compile

            [INFO] +- de.vanille-shop:Vanille-Shop_Entities:ejb:0.0.1-SNAPSHOT:compile

            [INFO] |  \- org.hibernate:hibernate-core:jar:3.3.1.GA:compile

            [INFO] |     +- antlr:antlr:jar:2.7.6:compile

            [INFO] |     +- commons-collections:commons-collections:jar:3.1:compile

            [INFO] |     +- dom4j:dom4j:jar:1.6.1:compile

            [INFO] |     +- javax.transaction:jta:jar:1.1:compile

            [INFO] |     \- org.slf4j:slf4j-api:jar:1.5.2:compile

            [INFO] +- de.datentraum:domainvalues:jar:0.0.1-SNAPSHOT:compile

            [INFO] +- de.vanille-shop:Vanille-Shop_Services:ejb:0.0.1-SNAPSHOT:compile

            [INFO] |  +- de.vanille-shop:Vanille-Shop_Entities:jar:0.0.1-SNAPSHOT:compile

            [INFO] |  +- net.sf.dozer:dozer:jar:5.2.0:compile

            [INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.8.0:compile

            [INFO] |  |  \- commons-lang:commons-lang:jar:2.4:compile

            [INFO] |  +- org.springframework:spring-jdbc:jar:2.5.6.SEC01:compile

            [INFO] |  |  \- org.springframework:spring-tx:jar:2.5.6.SEC01:compile

            [INFO] |  +- org.drools:drools-api:jar:5.0.1:compile

            [INFO] |  +- org.drools:drools-compiler:jar:5.0.1:compile

            [INFO] |  |  +- org.drools:drools-core:jar:5.0.1:compile

            [INFO] |  |  |  \- joda-time:joda-time:jar:1.6:compile

            [INFO] |  |  +- org.antlr:antlr-runtime:jar:3.1.1:compile

            [INFO] |  |  +- janino:janino:jar:2.5.15:compile

            [INFO] |  |  \- org.mvel:mvel2:jar:2.0.10:compile

            [INFO] |  \- com.thoughtworks.xstream:xstream:jar:1.3.1:compile

            [INFO] |     \- xpp3:xpp3_min:jar:1.1.4c:compile

            [INFO] +- commons-logging:commons-logging:jar:1.1.1:compile

            [INFO] +- org.springframework:spring-beans:jar:2.5.6.SEC01:compile

            [INFO] |  \- org.springframework:spring-core:jar:2.5.6.SEC01:compile

            [INFO] +- org.springframework:spring-context:jar:2.5.6.SEC01:compile

            [INFO] |  \- aopalliance:aopalliance:jar:1.0:compile

            [INFO] +- org.springframework:spring-aop:jar:2.5.6.SEC01:compile

            [INFO] +- de.vanille-shop:Vanille-Shop_Configuration:jar:0.0.1-SNAPSHOT:compile

            [INFO] +- com.sun.facelets:jsf-facelets:jar:1.1.15.B1:compile

            [INFO] +- org.richfaces.ui:richfaces-ui:jar:3.3.2.SR1:compile

            [INFO] |  \- org.richfaces.framework:richfaces-impl:jar:3.3.2.SR1:compile

            [INFO] |     +- commons-digester:commons-digester:jar:1.8.1:compile

            [INFO] |     \- org.richfaces.framework:richfaces-api:jar:3.3.2.SR1:compile

            [INFO] +- org.springframework:spring-web:jar:2.5.6.SEC01:compile

            [INFO] +- org.aspectj:aspectjweaver:jar:1.6.8:compile

            [INFO] +- cglib:cglib:jar:2.2:compile

            [INFO] |  \- asm:asm:jar:3.1:compile

             

             

            Do you need more?

             

            Thanks and regards,

            Alexander

            Hello,

            • 3. Re: ClassNotFoundException though having class deployed
              jaikiran

              Place the jars in .ear/lib folder. They'll be made available in the classpath of the entire .ear.

              • 4. Re: ClassNotFoundException though having class deployed
                rnit

                I am dealing with a similar problem. I have a JSF application built as war packaged inside an ear. I am using JBoss 5.0

                 

                I removed the jars from the web-inf\lib folder and placed all of them in ear\lib. However when I try to access the webapplication, it is unable to locate the jsf related jars inside the ear.

                 

                What am I doing wrong? The trace is as follows:

                 

                2010-11-08 17:44:56,266 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/xxxWebApp].[FacesServlet]] (XXXXX) Servlet.service() for servlet FacesServlet threw exception
                org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsf/html cannot be resolved in either web.xml or the jar files deployed with this application
                    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
                    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
                    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
                    at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:313)
                    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:148)
                    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
                    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:491)
                    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1438)
                    at org.apache.jasper.compiler.Parser.parse(Parser.java:137)
                    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
                    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
                    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:171)
                    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
                    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
                    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
                    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
                    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
                    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
                    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
                    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
                    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
                    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
                    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
                    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
                    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
                    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.cas.webapps.filters.LoginExpiredFilter.doFilter(LoginExpiredFilter.java:76)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
                    at org.apache.catalina.valves.RequestDumperValve.invoke(RequestDumperValve.java:151)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                    at java.lang.Thread.run(Thread.java:619)

                 

                Any help is appreciated.

                 

                Thanks,

                Ravi