1 Reply Latest reply on Aug 27, 2015 10:41 AM by Andy Clements

    java.lang.NoClassDefFoundError for class in jar in WEB-INF/lib

    Andy Clements Newbie

      Hello,

       

      I am running JBoss AS 7.1.1.Final and I am receiving the following error:

       

      ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/subcontractor].[controller]] (http--10.10.30.31-8443-12) Servlet.service() for servlet controller threw exception: java.lang.NoClassDefFoundError: com/xxxxx/queuemgr/BidNoticeForLateResponse

              at com.xxxxx.subcontractor.SubcontractorData.saveProjectResponseContact(SubcontractorData.java:516) [subcontractor.jar:]

              at com.xxxxx.subcontractor.SubcontractorData.saveSubcontractorResponse(SubcontractorData.java:125) [subcontractor.jar:]

              at com.xxxxx.servlet.ControllerServlet.processRequest(ControllerServlet.java:117) [subcontractor.jar:]

              at com.xxxxx.servlet.ControllerServlet.doPost(ControllerServlet.java:42) [subcontractor.jar:]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

       

      The classes SubcontractorData and ControllerServlet are in the same jar (as you can see from the error).  BidNoticeForLateResponse is in a different jar.  Both of these jars are in  the WEB-INF/lib of the war file and the war file is deployed on the server.  Now I read everywhere that class loader should be loading everything in the WEB-INF/lib directory, but for some reason I still get this error.  I have even tore apart the war/jar files to make sure they are really there.

       

      I must be missing something that would allow the class loader to find my class.  Any guesses?

       

      Thanks in advance for your help!