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 124587 - Invalid TLD file should be marked with error badge
Summary: Invalid TLD file should be marked with error badge
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-02 16:12 UTC by zign
Modified: 2017-11-30 15:03 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot showing the error log in status bar (75.67 KB, image/jpeg)
2008-01-02 16:17 UTC, zign
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zign 2008-01-02 16:12:43 UTC
When creating a web project from existing sources the jsp parser throws an exception and the status bar shows the
message "PWC6180: Unable to initialize TldLocationsCache" and no code completion can be done for the taglib.

When creating a completly new NetBeans Web project, with no initial frameworks, and then add the JSTL lib everything
works fine, this exception is never thrown and the jsp editor can code complete tags from the taglib.
Comment 1 zign 2008-01-02 16:17:24 UTC
Created attachment 54610 [details]
screenshot showing the error log in status bar
Comment 2 Petr Pisl 2008-01-02 17:00:50 UTC
Hi, is it the project with exsisting sources a specific project? Or it doesn't work for any web project from existing
sources?

Comment 3 zign 2008-01-14 10:39:22 UTC
Hi, sorry for the late response.

It is  specific web project created outside netbeans. It seems that it is complaining about some of the the tld files
residing in WEB-INF/tags. Some of these tld's might be faulty, but NetBeans 5.5.1 managed to parse the tld's that are
not faulty and make the tags present in code completion, in NetBeans 6.0 parsing of all taglibs are interrupted and no
tags at all are shown in the JSP's editors code completion feature.
Comment 4 Tomas Mysik 2008-02-13 15:33:38 UTC
How can I reprodue this issue? Is it possible to attach your project please?

Please notice that the cache of tag libraries has been rewritten (for more info see issue #123370).
Comment 5 zign 2008-02-14 10:32:08 UTC
No, it's impossible since it's a proprietary project, another issue is that it's just too big to be attached here.

But, as mentioned earlier, the error seems to appear when one or more tag lib descriptors(tld) for custom tags are
faulty. In our project they reside in WEB-INF/tags. When one of these are faulty this also affects the jsp code
completion for taglibs that are correct defined, such as the JSTL and others.

I tried this by creating a web project with JSTL included, then jsp taglib code completion works fine, but when I add
custom tags with faulty tld the jsp taglib code completion is not working, not even for JSTL.

The strange thing here is that when our project is deployed in tomcat, in my scenario, the app works great in spite of
the faulty tld and understand the custom tags anyway. Seems there is something in the NetBeans jsp parser that makes it
go wrong. Just a guess.
Comment 6 Tomas Mysik 2008-02-14 10:39:23 UTC
Thanks for your report - I will look at it.
Comment 7 Tomas Mysik 2008-02-24 14:54:15 UTC
I tried to reproduce this problem - and in fact you are right. Here is what I did:
- create new Web project with Struts framework and all the TLD files
- invalidate any of those TLD files (e.g. remove opening root tag)
- invoke code completion => error occurs during TLD files reparsing (e.g. "PWC6178: XML parsing error on 
file /WEB-INF/struts-bean.tld: (line 4, col 6)")
Are these steps correct?

Well, the question now is what NB should do. I think that probably the best behaviour would be to inform user that an 
error occured during parsing (there could be problems with I18N here). Any comments/suggestions?

Few notes:
- I don't think that this issue could be a regression because there were no changes in this area (the only possibility 
is that jasper's behaviour in NB 5.5 would be different, NB 6.0 uses new version).
- corrupted TLD file is not marked as invalid - but I think it should be
Comment 8 Tomas Mysik 2008-02-25 09:38:33 UTC
Because it's not a regression and because of invalid TLD file - changing priority to P3.
Comment 9 Jiri Prox 2008-04-11 01:18:54 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 10 gnewton 2008-04-22 12:27:49 UTC
This may be related - i am getting the message "Could not add one or more tag libraries" for the following (simplified)
example:

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0">
<jsp:output doctype-root-element="html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />

</jsp:root>
Comment 11 Anton Chechel 2011-04-28 12:37:12 UTC
Product Version: NetBeans IDE Dev (Build 20110411-95fa2f6ba3a6)
Java: 1.6.0_23; Java HotSpot(TM) 64-Bit Server VM 19.0-b09
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Userdir: C:\Projects\netbeans\web-main\nbbuild\testuserdir

Code completion works for me in case of Comment #7 steps.
The only issue left is: incorrect TLT file should be marked with error badge.
Decreasing priority to P4.
Comment 12 Martin Balin 2016-07-07 08:55:27 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 13 tonyattwood 2017-08-17 19:44:33 UTC
I seem to be experiencing this problem under 8.2.  The error message is:

Unable to read TLD "META-INF/tld/struts-html.tld" from JAR file "file/C:/Program%20Files/NetBeans%208.2/enterprise/modules/ext/struts/struts-taglib-1.3.10.jar: org.apache.jasper.JasperException: PW6112: Failed to load or instantiate TagExtraInfo class org.apache.struts.taglib.html.MessagesTei
Comment 14 tonyattwood 2017-08-17 19:56:57 UTC
Forget my last post please - have fixed it.
Comment 15 tonyattwood 2017-11-30 15:03:10 UTC
Perhaps I should have said that the fix was to put

<%@page pageEncoding="UTF-8"%>

at the top of the page