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 134424 - NoClassDefFoundError: javax/servlet/jsp/tagext/TagInfo
Summary: NoClassDefFoundError: javax/servlet/jsp/tagext/TagInfo
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jesse Glick
URL: http://statistics.netbeans.org/except...
Keywords:
: 134487 134584 134844 (view as bug list)
Depends on: 136536
Blocks: 129772 134627 134896
  Show dependency tree
 
Reported: 2008-05-02 19:02 UTC by Dan Kolar
Modified: 2008-12-23 08:36 UTC (History)
12 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 50428


Attachments
stacktrace (6.62 KB, text/plain)
2008-05-02 19:02 UTC, Dan Kolar
Details
exception (2.60 KB, text/plain)
2008-05-05 23:08 UTC, David Konecny
Details
stacktrace (2.71 KB, text/plain)
2008-05-12 19:17 UTC, frankioski
Details
stacktrace (2.71 KB, text/plain)
2008-05-12 19:23 UTC, frankioski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kolar 2008-05-02 19:02:33 UTC
Build: NetBeans IDE Dev (Build 20080502153545)
VM: Java HotSpot(TM) Client VM, 11.0-b11, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b21
OS: Windows XP, 5.1, x86

User Comments: 
Created project with all 4 basic frameworks
Comment 1 Dan Kolar 2008-05-02 19:02:41 UTC
Created attachment 60982 [details]
stacktrace
Comment 2 Dan Kolar 2008-05-05 09:45:46 UTC
*** Issue 134487 has been marked as a duplicate of this issue. ***
Comment 3 Marek Fukala 2008-05-05 12:13:04 UTC
It looks like servletjspapi module is not loaded or simply there is no ext/servlet2.5-jsp2.1-api.jar on the runtime
classpath.
Comment 4 David Konecny 2008-05-05 23:06:16 UTC
Tomas may know more about this. I tried following: create new Web Project (with or without Libraries folder - does not
matter) and add Struts framework and tick "Add Struts TLD" and result is similar: editor status bar says " PWC6180:
Unable to initialize TldLocationsCache" and console shows "SAXException: PWC6181: File
/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd not found" - see attachment for more details. Looks like JSP
parser classpath is incomplete but I do not know why.
Comment 5 David Konecny 2008-05-05 23:08:16 UTC
Created attachment 61062 [details]
exception
Comment 6 David Konecny 2008-05-05 23:16:30 UTC
I think this is serious regression. Try creating Web Project with Visual JSF - fails with CNFW and design page is never
opened.
Comment 7 David Konecny 2008-05-05 23:45:30 UTC
*** Issue 134455 has been marked as a duplicate of this issue. ***
Comment 8 Tomas Mysik 2008-05-06 09:05:46 UTC
Are we able to find out when this situation started to happen? I did not change anything in JSP parser for quite a 
long time (from january I guess).
Comment 9 David Konecny 2008-05-06 09:41:37 UTC
Ask QA to try out couple of old builds.
Comment 10 Jan Horvath 2008-05-06 10:14:33 UTC

*** This issue has been marked as a duplicate of 134136 ***
Comment 11 Jan Horvath 2008-05-06 10:18:16 UTC
closed by mistake
Comment 12 Marek Fukala 2008-05-06 10:28:15 UTC
It has nothing to do with frameworks, it happens to me even for pure web project with jsp files. I asked Jinra Sedek to
try to find the first build with the problem. The first report AFAIK is issue 131136 against build 080429.
Comment 13 alanbur 2008-05-06 10:54:36 UTC
This issue was present in 1.6 when it shipped but not 5.5.1, if that helps any.
Comment 14 Jindrich Sedek 2008-05-06 10:54:42 UTC
I'm able to reproduce the problem using build 200804300004, but it doesn't appear for 200804290004 yet. 29.04. is the
day of first problem occurences
Comment 15 alanbur 2008-05-06 10:57:47 UTC
In that case, 134455 is *not* a duplicate of this bug, as the problem described in 134455 has been there since 6.0.  I'm
therefore reopening 134455
Comment 16 Marek Fukala 2008-05-06 14:13:58 UTC
Jesse, cannot the problem be caused by your changes from Apr 28th in the following changeset?

http://hg.netbeans.org/main?cmd=changeset;node=7ccf89a50f5f

There doesn't seem to be any change in the servletjspapi module or those modules which loads classes from it around the
date when it stopped working accoring to Jindra's findings.

Or any other idea what could be the problem?

Comment 17 Jesse Glick 2008-05-06 17:09:34 UTC
I don't know offhand of any reason why the nbjcl -> jar change (intended to affect just ClassLoader.getResource, not
loadClass) would cause a NCDFE like this (just in this module and not in any of the many other modules which use CP
extensions), though it is possible of course. (Easy enough to verify, no need to guess.) It is certainly suspicious that
the class in question is present in four (!) different JARs in NB sources:

j2ee.dd/external/javaee-api-5.jar
servletapi/external/servlet-2.2.jar
servletjspapi/external/servlet2.5-jsp2.1-api.jar
web.monitor/external/servlet-2.3.jar

Obviously if you can narrow down the problem to a test case demonstrating fault in the module system that would be
helpful. BTW I am at JavaOne this week and don't have much time to look at it.
Comment 18 davideconsonni 2008-05-07 14:18:28 UTC
my stacktrace is:

SEVERE [org.openide.util.RequestProcessor]
java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagAttributeInfo
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        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:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:244)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Caused: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagAttributeInfo
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.filterList(JspSyntaxSupport.java:461)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getTagPrefixes(JspSyntaxSupport.java:475)
        at
org.netbeans.modules.web.core.syntax.completion.JspCompletionQuery.queryJspTagInContent(JspCompletionQuery.java:581)
        at org.netbeans.modules.web.core.syntax.completion.JspCompletionQuery.query(JspCompletionQuery.java:133)
        at org.netbeans.modules.web.core.syntax.completion.JspCompletionProvider.queryImpl(JspCompletionProvider.java:192)
        at
org.netbeans.modules.web.core.syntax.completion.JspCompletionProvider$Query.doQuery(JspCompletionProvider.java:110)
        at
org.netbeans.modules.web.core.syntax.completion.JspCompletionProvider$AbstractQuery.query(JspCompletionProvider.java:211)
        at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:218)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Comment 19 davideconsonni 2008-05-07 16:58:27 UTC
may be a dependency missing in one project ?

TagAttributeInfo shuld be here:

               <dependency>
                    <code-name-base>org.netbeans.modules.servletjspapi</code-name-base>
                    <build-prerequisite/>
                    <compile-dependency/>
                    <run-dependency>
                        <release-version>1</release-version>
                        <specification-version>1.3</specification-version>
                    </run-dependency>
                </dependency>
Comment 20 David Konecny 2008-05-07 22:54:16 UTC
Re. "may be a dependency missing in one project" - I had a quick look yesterday but did not find anything. Dependency is
there otherwise module would not compile. I sometimes got this exception and sometimes not so its random to some extent.
Comment 21 Exceptions Reporter 2008-05-08 08:56:26 UTC
This issue has already 5 duplicates 
Comment 22 davideconsonni 2008-05-08 09:25:01 UTC
i think that the project compile because the class is loaded in ProxyClassLoader(line: 189) class in the method:

    protected synchronized Class loadClass(String name, boolean resolve)
                                            throws ClassNotFoundException {
at line 244:
if (cls == null && shouldDelegateResource(path, null)) cls = systemCL.loadClass(name); // may throw CNFE
this can throws a runtime exception

Comment 23 Exceptions Reporter 2008-05-11 02:47:38 UTC
This issue has already 10 duplicates 
Comment 24 Dan Kolar 2008-05-12 10:44:28 UTC
*** Issue 134844 has been marked as a duplicate of this issue. ***
Comment 25 Marek Fukala 2008-05-12 14:16:40 UTC
Reassigning to core for evaluation since it looks like some problem with classloading. The issue appears only sometimes,
it is hard to say when exactly. Once it appears any module cannot load any class from the servletjspapi module even
after netbeans restart.
Comment 26 _ potingwu 2008-05-12 17:09:39 UTC
> The issue appears only sometimes, it is hard to say when exactly.

You can just try to create a new Visual Web project. The NoClassDefFoundError happened ALWAYS! Hence no any new Visual
Web project can be created from the current trunk build for > 2 weeks!!
Comment 27 frankioski 2008-05-12 19:17:48 UTC
Build: NetBeans IDE Dev (Build 200805110004)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
Just installed the 6.1 Dev 200805110004 build. Started it for the first time, and it hung on me when I tried to open an existing JSP file. I shut it down and restarted it and now I get this NoClassDefFoundError.  The JSP editor is currently showing a blank gray for the same JSP that I tried to open the first time.
Comment 28 frankioski 2008-05-12 19:17:56 UTC
Created attachment 61280 [details]
stacktrace
Comment 29 frankioski 2008-05-12 19:23:02 UTC
Build: NetBeans IDE Dev (Build 200805110004)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05, Java(TM) SE Runtime Environment, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
Running NB 6.1 200805110004.
Noticed Output window displaying an error ("cvc-complex-type.2.4.d: Invalid content..."). I clicked on the error link in said window and this NoClassDefFoundError appeared.  This "Invalid content" error is the same error that I reported in issue #132837 on Tue Apr 15 04:25:00 +0000 2008.
Comment 30 frankioski 2008-05-12 19:23:10 UTC
Created attachment 61282 [details]
stacktrace
Comment 31 Jesse Glick 2008-05-12 19:23:52 UTC
I just did a clean build of a5d6c99ca801 (from today), started on JDK 6 w/ new userdir, and created the "Travel Center"
sample project. I was warned that the target server was not set but did not see any NCDFE. Cannot seriously evaluate
without reliable (and detailed) steps to reproduce from scratch.
Comment 32 Jesse Glick 2008-05-12 19:52:40 UTC
After setting GFv2 as the app server and opening a JSP, I get a

java.lang.ClassNotFoundException: com.sun.rave.faces.util.DesignTimeComponentBundle
        [....]
	at java.lang.Class.forName(Class.java:164)
	at com.sun.rave.faces.util.ComponentBundle.getBundle(ComponentBundle.java:145)

but I guess that could be some unrelated bug. From inspecting the source code I don't see any obvious reason why it is
using reflection at all; appears that it could simply replace

try {
  cb = (ComponentBundle)Class.forName(DESIGN_TIME_IMPL_CLASS).newInstance();
} catch (Exception e) {
  throw new RuntimeException("Could not create instance of " + DESIGN_TIME_IMPL_CLASS, e);
}

with

cb = new DesignTimeComponentBundle();
Comment 33 Jesse Glick 2008-05-12 20:02:24 UTC
I did manage to get a NCDFE on JspException from JavaSourceProviderImpl.FilterImpl.filterCharSequence under some
conditions which is probably similar enough to investigate.
Comment 34 Jesse Glick 2008-05-12 21:35:04 UTC
I think the root bug is in org.apache.jasper.compiler.TldLocationsCache.scanJar, which closes a JarFile it did not
create; in #7ccf89a50f5f I honored the contract of JarURLConnection.getJarFile, which TLC.sJ seems to abuse. The problem
in the form of an ISE was being masked by JarClassLoader.JarSource.resource.
Comment 35 Jesse Glick 2008-05-12 22:01:38 UTC
Can work around Jasper bug: #7d33b9d2ed38 (will push to core-main).
Comment 36 Marek Fukala 2008-05-14 10:43:59 UTC
*** Issue 134584 has been marked as a duplicate of this issue. ***
Comment 37 Quality Engineering 2008-05-14 16:05:19 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #195 build
Changeset: http://hg.netbeans.org/main/rev/7d33b9d2ed38
User: Jesse Glick <jglick@netbeans.org>
Log: #134424: NCDFEs ultimately due to a bug in Jasper (closes foreign JarFile's).