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 197633 - Still getting the absolute url xxxxxx cannot be resolved in web.xml error, even in RC2
Summary: Still getting the absolute url xxxxxx cannot be resolved in web.xml error, ev...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 7.0
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-11 21:16 UTC by bhulse
Modified: 2011-05-26 22:08 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project that demonstrates the problem. (2.37 MB, application/x-zip-compressed)
2011-04-13 14:48 UTC, bhulse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bhulse 2011-04-11 21:16:02 UTC
I had created a bug about 6.9.1 projects, when opened with 7.1 beta 1 not being able to resolve the taglib uri via web.xml. This bug (195586) was made a duplicate of 192308. However, when I pulled RC2 this morning, the original problem still exists:

I have a taglib directive in my file:
<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>

that gets tagged with the error about not being able to resolve it through web.xml.

My web.xml (unchanged from what was used with 6.9.1):
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <jsp-config>
        <taglib>
            <taglib-uri>http://www.ptc.com/infoengine/taglib/core</taglib-uri>
            <taglib-location>/WEB-INF/infoengine-core.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://www.ptc.com/infoengine/taglib/directory</taglib-uri>
            <taglib-location>/WEB-INF/infoengine-directory.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://www.ptc.com/windchill/taglib/util</taglib-uri>
            <taglib-location>/WEB-INF/util.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://www.ptc.com/infoengine/taglib/iejstl</taglib-uri>
            <taglib-location>/WEB-INF/iejstl.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://www.ptc.com/infoengine/taglib/xsl</taglib-uri>
            <taglib-location>/WEB-INF/xsl.tld</taglib-location>
        </taglib>
    </jsp-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

Something is different between 6.9.1 and 7.0 that is causing this problem. I have tried working around it to no avail. Once that error is encountered, all other validation (scriptlet code, tag completion) is unavailable.
Comment 1 Anton Chechel 2011-04-12 07:01:08 UTC
Could you please attach your project here?
Comment 2 bhulse 2011-04-13 14:48:49 UTC
Created attachment 107722 [details]
Project that demonstrates the problem. 

Unzip it and open it with both 6.9.1 and 7.0RC2 and see the error in 7.0RC2 about not being able to resolve the uri via web.xml or the libraries in the project
Comment 3 bhulse 2011-04-21 19:49:33 UTC
Is the problem I'm having due to splitting off the sysclasspath from the normal classpath? It seems like maybe the sysclasspath is used by the editor to resolve the classes involved for editing, separately from those used in the edited jsps.

If that is the case, how would I modify the sysclasspath to add my additional jar so it would see the class pointed to by the tld?
Comment 4 Petr Jiricka 2011-05-06 15:33:38 UTC
I am able to reproduce. Also, if I compile the JSP page, there is an error in the output window:

java.lang.ClassNotFoundException: com.infoengine.jsp.taglibs.GetServiceTagExtraInfo
	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 java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:546)
        ...
Comment 5 David Konecny 2011-05-25 02:47:04 UTC
I had a look at this issue and the problem is that org.netbeans.modules.web.jspparser.ParserServletContext.getJspConfigDescriptor() returns dummy empty object. org.apache.jasper.runtime.TldScanner.processWebDotXml() uses that method to iterate over taglibs defined in web.xml but our dummy implementation is empty. I tried to hotfix this (by reading only taglibs defined in web.xml; correct solution would be to scan not only web.xml but also web-fragment.xml but in order to do that org.netbeans.modules.j2ee.dd.api.web.WebAppMetadata would have to be extended and merging of taglibs implemented) but I got a deadlock immediately. May try better fix tomorrow if nobody else fixed this in meantime.
Comment 6 David Konecny 2011-05-25 02:48:06 UTC
Short term workaround: add <uri> to infoengine-*.tld definitions, ie.:

     ...
     <shortname>infoengine-core</shortname>
->   <uri>http://www.ptc.com/infoengine/taglib/core</uri>
     <info>
     ...

And similarly for other infoengine TLDs.
Comment 7 Petr Jiricka 2011-05-25 08:34:16 UTC
A similar problem is in bug 198637, I must say I just fixed the easy way: http://hg.netbeans.org/web-main/rev/ce5c1f9177d4 (would be good if you could review this fix too, David)

Do we know concrete examples of frameworks/libraries that provide web-fragment.xml with taglib declarations?
Comment 8 David Konecny 2011-05-26 01:37:33 UTC
(In reply to comment #7)
> A similar problem is in bug 198637, I must say I just fixed the easy way:
> http://hg.netbeans.org/web-main/rev/ce5c1f9177d4 (would be good if you could
> review this fix too, David)

As a hotfix it looks OK to me. I will do the same for this issue. Initially I did the same but wrapped the call in MetadataModel.runReadAction which caused instant deadlock.

> Do we know concrete examples of frameworks/libraries that provide
> web-fragment.xml with taglib declarations?

No I do not, but it is a matter of time. P3-P4 though.

Proper fix should use MetadataModel. But as far as I know JSP parsing is prone to deadlocks so I'm happy to leave this for somebody else to resolve it properly with rewrite or JSP parsing. On the other hand I wonder how was this done previously??

Is there time to integrate this fix into 7.0.1??

3e8a35f69f05
Comment 9 Petr Jiricka 2011-05-26 09:45:19 UTC
Yes this should be also in 7.0.1 - done: http://hg.netbeans.org/releases/rev/0a6592cbf685. Thanks for fixing David.
Comment 10 Quality Engineering 2011-05-26 22:08:49 UTC
Integrated into 'main-golden', will be available in build *201105261343* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3e8a35f69f05
User: David Konecny <dkonecny@netbeans.org>
Log: #197633 - Still getting the absolute url xxxxxx cannot be resolved in web.xml error, even in RC2