0

I have a simple web application (one jsp and one servlet) file that I've copied into jboss-4.0.2/server/default/deploy folder and it has successfully hot deployed as I can access the jsp page. However, when I invoke the servlet, I am getting a java.lan.NoClassDefFoundError.

I suspect that the jars under the WEB-INF/lib directory within the war is not being picked up.

The structure of my war is:

META-INF  
  -->  MANIFEST.MF  
WEB-INF  
  -->  classes  
          --> ...*.classes  
  -->  lib  
          --> jcommon-1.0.16.jar  
              jfreechart-1.0.13.jar  
              servlet-api.jar  
index.jsp  

Anybody else have classloading issues in JBoss 4?

Many thanks.

skaffman
  • 398,947
  • 96
  • 818
  • 769

1 Answers1

1

At the very least, you should not have the servlet-api.jar file in there. Those classes should all be provided by the Servlet container (in your case, JBoss).

Adam Batkin
  • 51,711
  • 9
  • 123
  • 115
  • I agree. It's just there as it's in the version control system. Note that the war works fine in Tomcat 6. – boongywoongy Mar 24 '10 at 10:14
  • 1
    (+1) The `servlet-api.jar` could cause weird classloading issues in JBoss, which has a very different classloader to Tomcat. – skaffman Mar 24 '10 at 10:29