JSP pages compilation failure with WebSphere Application Server with java.lang.NoClassDefFoundError
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
Error]-[org/eclipse/jdt/internal/compiler/env/INameEnvironment]:
java.lang.NoClassDefFoundError:
org/eclipse/jdt/internal/compiler/env/INameEnvironment
at
com.ibm.ws.jsp.translator.compiler.JDTCompilerFactory.createJspCompiler(JDTCompilerFactory.java:17)
at
com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJspAndCompile(JspTranslatorUtil.java:117)
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...


Posted by Ashwin on February 08, 2007 at 08:15 AM PST #
Posted by 71.146.140.78 on March 05, 2007 at 07:21 PM PST #
Posted by spoonyfork on August 01, 2007 at 01:27 PM PDT #