1 Reply Latest reply on Oct 12, 2004 11:40 AM by Scott Stark

    JSP compiles but doesn't run (NoClassDefFoundException)

    Steve Wall Newbie

      I'm fairly new to JBoss, currently running v3.2.5, java runtime 1.4.2.

      I'm trying to deploy a simple JSP inside a WAR file. The JSP references a class that is in the WEB/INF/classes directory within the WAR, and this class references classses OUTSIDE the WAR file (in a shared jar file). The shared jar file is loaded via jboss-service.xml via the classpath tag.

      When I run the JSP, it compiles fine (the .class file is created...), but when it is run via JSPServletWrapper.service I get a runtime NoClassDefFoundException that references the shared class within the shared jar. I know the exception is thrown from within JSPServletWrapper.getServlet() when it tries to load the compiled JSP file via theServlet.newInstance() since I've traced it inside the source code

      I've tried to track this down via classpaths, classloaders, even downloaded and looked at the JBoss source code (very fun!), but I've yet to figure out the problem.

      I'd bet it's something pretty straightforward, but since I'm new to JBoss perhaps I'm being tripped up on something obvious (?).

      Thanks in advance for any help. The starcktrace is included below...

      Steve


      at COM.mendosoft.TnB.TnBWelcome.(Unknown Source)
      at org.apache.jsp.jsp.TnBProductMaintenance_jsp.(TnBProductMaintenance_jsp.java:14)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at java.lang.Class.newInstance0(Class.java:308)
      at java.lang.Class.newInstance(Class.java:261)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(Unknown Source)
      at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
      at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:534)