JSP pages compilation failure with WebSphere Application Server with java.lang.NoClassDefFoundError
By dkumar on Oct 24, 2006
I happen to run into java.lang.NoClassDefFoundError when trying to run one of the sample JSP pages(hitcount) on WebSphere Application Server V6.1. Here is the exception trace(first few lines only):
[10/13/06 16:32:51:941 PDT] 00000026 WebApp E [Servlet
As we know that V6.1 has Eclipse based JSP compiler which uses JDT(Java Development Tooling) and AST(Abstract Syntax Tree) Parser for parsing and generating the java code.
This compiler depends on some of the user env settings and if not propogated well to the compiler during the compiler initialization it may fail to initilize properly. There are two workarounds to this problem:
- The easiest one is to install as any non-root user and everything should work as expected.
- The other route you can take is modify your web archive descriptor to have JDK compiler or you can use jikes as well.
To modify the compiler used for you JSP compilation you can edit your ibm-web-ext.xmi file under the web module deployment directory and can have a line similar to this:
<jspAttributes xmi:id="JSPAttribute_XXXXX" name="useJDKCompiler" value="true"/>
For XXXXX you can put any number all you have to do is just make sure JSPAttribute_XXXXX is unique. There are bunch of other as well which can be changed for you web-application.
From IBM web-site looks like the fix for this is also going to be released very soon...