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.
In a standard web project if I select the Compiling option to "Test compile all JSP files during builds" the following error is generated consistently: java.lang.NoClassDefFoundError: org/apache/jasper/JspC I cannot find anyway to get past this error. There is a similar error mentioned in the help documentation which suggests a caching problem. However, I tried deleting the cache and restarting NB to no avail. It appears that Netbeans classpath is incorrect?
I assume you are using the latest build, right? This was already reported as issue 55632, which I just fixed. Marking as duplicate. *** This issue has been marked as a duplicate of 55632 ***
This is actually not a duplicate of 55632 as I performed a different action (precompile all jsp's as part of build) and get a different exception (NCDFE on JspC rather than JspCSingle). I am still getting this exception in the March 6 daily build. I've also verifed that this same exception occurs using the recipie in 55632, i.e. compilng a single jsp. Here the exception: java.lang.NoClassDefFoundError: org/apache/jasper/JspC at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Yes, this looks like a different issue. 55632 was about missing copyfiles.jar in classpath, this problem is missing jasper-compiler-X.Y.Z.jar. Can you please check jspc.classpath property in build.properties file in user direcory? Is jasper-compiler-X.Y.Z.jar on this classpath and does the file listed here actually exist? Thanks!
I think I see the problem. This is a Windows installation and yet the jspc.classpath entry in <userdir>/build.properties uses ":" instead of ";" as the path separator. All of the other classpath entries in build.properties with multiple paths used ";" as the path separator. The jasper-compiler-5.5.7.jar entry on the class path does exist where it should (in enterprise1/modules/autoload/ext), so that is not the problem. Here is the jspc.classpath entry, and another multi-path classpath entry in build.properties to show the difference: jspc.classpath=C:\\Program Files\\netbeans-4.1dev\\ide5\\ant\\lib\\ant.jar:${j2ee.platform.classpath}:C:\\Program Files\\netbeans-4.1dev\\enterprise1\\modules\\autoload\\ext\\jasper-compiler-5.5.7.jar:C:\\Program Files\\netbeans-4.1dev\\enterprise1\\modules\\autoload\\ext\\jasper-runtime-5.5.7.jar:C:\\Program Files\\netbeans-4.1dev\\enterprise1\\modules\\autoload\\ext\\commons-el.jar:C:\\Program Files\\netbeans-4.1dev\\ide5\\modules\\ext\\commons-logging-1.0.4.jar libs.jstl11.classpath=C:\\Program Files\\netbeans-4.1dev\\enterprise1\\config\\TagLibraries\\JSTL11\\standard.jar;C:\\Program Files\\netbeans-4.1dev\\enterprise1\\config\\TagLibraries\\JSTL11\\jstl.jar
Did you try to replace : with ;? thanks.
I just tried replacing the :'s with ;'s in build.properties and it did NOT work. I get the same NCDFE. I tried both single-file jsp compilation and the build precompile all jsp's option, both getting the NCDFE. However, this might not be conclusive as peraps <userdir>build.properties is not always reread? I don't know. The :'s seem suspect, but just changing them in build.properties is not sufficient to fix the problem.
Did you create this project in NetBeans 4.1, or did you upgrade it from NetBeans 4.0? If you upgraded, then this may be the same issue as bug 56054, which I just fixed. Can you re-upgrade your project again in tomorrow's build? Either way, please also check the value of the jspcompilation.classpath property in project.properties. It should be like this: jspcompilation.classpath=${jspc.classpath}:${javac.classpath}
Yes, the project was upgraded from 4.0. I'm not sure how to re-upgrade the project since it is already upgraded and I've proceeded to develop with 4.1. (I suppose it would be possible to swap my projects folder with a backup 4.0 copy or something like that, but I'd prefer not to if there is an easier way to verify. CVS tends to get very unhappy when things are moved around. Perhaps this is rendered moot by the following.) project.properties has no entry for jspcompilation.classpath. The only property involving the substring "jsp" is compile.jsps=true COuld that be the problem?
The remedy of this problem is to add the jspcompilation.classpath property with the correct value, that should work. You don't need to re-upgrade, just add the property. Marking as a duplicate of 56054. *** This issue has been marked as a duplicate of 56054 ***
That is correct. Adding jspcompilation.classpath=${jspc.classpath}:${javac.classpath} to project.properties corrects the problem. Thank you!