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...

Comments:

I'm working on linux and tried to solve the problem using both approaches you suggested and couldnt solve problem please help

Posted by Ashwin on February 08, 2007 at 12:15 AM PST #

The patch is already available for Linux which should solve this issue. BTW did you try running WebSphere on Open Solaris.

Posted by guest on March 05, 2007 at 11:21 AM PST #

This below article http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q1=java.lang.NoClassDefFoundError&uid=swg1PK32406&loc=en_US&cs=utf-8&lang=en resolved the issue for me on Windows Xp RAD7 WAS 6.1.0.2. Supposedly the issue is resolved in 6.1.0.3. Summary: Use the JDK compiler instead of the JDT compiler. Use jsp config parameter useJDKCompiler=true for this switch.

Posted by spoonyfork on August 01, 2007 at 06:27 AM PDT #

IBM WebSphere Application Server provides periodic fixes for the base, Network Deployment, and Express editions of release 6.0.2. The following is a complete listing of fixes for Version 6.0.2 with the most recent fix at the top.

Posted by kollagen on December 08, 2009 at 01:31 AM PST #

Post a Comment:
Comments are closed for this entry.
About

dkumar

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today