This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 198293 - Compile JSP files during build fails with NoClassDefFoundError
Summary: Compile JSP files during build fails with NoClassDefFoundError
Status: RESOLVED DUPLICATE of bug 198056
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.0
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Anton Chechel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 20:48 UTC by stevefyfe
Modified: 2011-05-26 16:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stevefyfe 2011-05-03 20:48:50 UTC
After upgrade from NB 6.9.1 to NB 7.0, a web project that has the option "Test compile all JSP files during builds" enabled will fail due to wrong classpath for the JSP Compiler.

The reported error is:
java.lang.NoClassDefFoundError: org/netbeans/modules/web/project/ant/JspC
Caused by: java.lang.ClassNotFoundException: org.netbeans.modules.web.project.ant.JspC
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.netbeans.modules.web.project.ant.JspC.  Program will exit.
Comment 1 stevefyfe 2011-05-03 20:50:34 UTC
I diagnosed it as a problem with the upgrade from NB6.9 to NB7.0. NB6.9 had installed a library in my project specific library folder, but when NB7 was installed, it did not change the contents of that library. So NB7 tried to compile the JSPs using the classpath intended for NB6.9, which failed.

I created a new project and compared the nblibraries.properties file from the new project with my original project. I found a library defined in both named jsp-compilation but the jar files defined in that library did not match.

To fix the problem I had to upgrade that library by hand. I changed the nblibraries.properties file to look like this:
libs.jsp-compilation.classpath=\
    ${base}/jsp-compilation/ant.jar:\
    ${base}/jsp-compilation/servlet3.0-jsp2.2-api.jar:\
    ${base}/jsp-compilation/glassfish-jspparser-3.0.jar:\
    ${base}/jsp-compilation/jsf-api.jar:\
    ${base}/jsp-compilation/jstl.jar:\
    ${base}/jsp-compilation/ant-launcher.jar


And I put those jar files into that folder, replacing the ones that were already there. This resolved the problem.
Comment 2 stevefyfe 2011-05-26 16:24:38 UTC

*** This bug has been marked as a duplicate of bug 198056 ***