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.
I have been struggling with the code completion in netbeans 6`s jsp editor. the code completion functionality is very intermittent, working for some projects and not others. ie, when writing the jsp scriptlet: <% String foo = new String(); foo.<--should get the string api on popup, instead i get "no suggestions" %> Code completion does not work at all for my larger projects, i also intermittently get this error in the ide when a jsp editing in a larger project is open: Exception in thread "Init TldLocationCache" java.lang.AbstractMethodError: gnu.xml.dom.DomDocument.setDocumentURI(Ljava/lang/String;)V at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:226) at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:274) at org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCache.java:374) at org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:312) at org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:272) at org.netbeans.modules.web.jspparser_ext.WebAppParseSupport$InitTldLocationCacheThread.run(WebAppParseSupport.java:1005) could the jsp module be using different xml libraries, perhaps even those from projects classpaths?, i know there are a few old xml implementations in one of my projects classpaths. I have attached two messages.log file with the -Djaxp.debug=1 switch enabled to capture what its doing with the xml parsers. one when code completion is working and one where code completion does not work. cheers,
*** Issue 123319 has been marked as a duplicate of this issue. ***
Created attachment 53812 [details] simple output when code completion fails
Created attachment 53813 [details] sam as above, with xml debug
Created attachment 53814 [details] output when code completion is working (with xml debug)
I guess the java.lang.AbstractMethodError is the cause of the problem. The completion cannot provide the proper items if the parsing fails.
Reporter, can you please specify the libraries you are using in your project, or attach the whole project? This would help us simulate this error. Thanks.
We need to reproduce this error to be able to help you - please see the last comment ('pjiricka Mon Feb 18 12:32:35 +0000 2008'). Thanks.
*** Issue 89133 has been marked as a duplicate of this issue. ***
No response from reporter, so closing as WORKSFORME. If the problem still exists, reopen this issue and provide requested information. Thanks.
When you have a Java free-form project (not a Web free-form project), and add another source folder (for example a modul) which is at a different location, the code completion will not work in the java source and either in jsp. In nb 6.1 with the same project, import finds the modul in java sources only, in jsp the <%@page import="..."%> will find the package, but in the jsp, the code completion is still bad. This is the main issue, holding me at nb5.5, because in nb5.5 it works fine. Tested with version: Netbeans 6.5 200807040101 development version. I added servlet-api.jar and jsp-api.jar to the project from tomcat 5.5.26
I will look at it, thanks.
To roti: do you get the same error as in the initial description? If not, please file a new issue. If yes, are you able to attach your project or create a sample one? Do you get this exception for all your Web applications? What libraries are you using in your project? What type of project? To porkoboe: could you please provide more information - what type of project are you using, regular Web Application or Web Free-Form Application? Also, are you able to provide a sample project I can play with? You have provided 2 files - for working and failing code completion - does it mean that it fails only for some project? Or is it random issue? It would be very helpful if you could provide exact steps to reproduce or even better attach some sample project I can use. I've tried to reproduce your issue (your first description), but it works for me. Thanks a lot.
ok, I figured it out: I mustn't use Java Free-form project. I must create a Web Free-form project. In this case, the jsp code completion works with modules in most cases, except this one: When I have an include in jsp like: <%@include file="../../html/portal/adminHeader.html"%> nb will indicate the following error with red in the status bar: "/company/myJsp.jsp(18,0) PWC6308: The path /company/../../hmtl/portal/adminHeader.html specifies a resource outside the web application" and from that point, the code completion wont work. If I comment out the include, the completion will work immediatelly. my directory structure: src |---com | |---mypackage | | `---classes | ... |---jsp | |---company | ... |---html | |---portal | ... My path is ok, because my project get built well, and even the path completion works great for that path. In the project my Web pages folder set to: \src\jsp and the java sources set to /src (in nb5.5 it was not a problem) This occurs with nvb6.1 current, and nb6.5 beta too
Thanks, I will look at it.
To roti: The error is right because your project has incorrect directory structure - you say that your document root is "src/jsp" but you are trying to include file which is *not* located underneath the document root. Moreover, you are mixing Java sources and Web sources which can cause problems, see issue #121684 for more information and explanation. One more note - I already asked you whether you get the same error as in the initial description - apparently not, so please do not comment more to this issue, feel free to file a new one. Thanks a lot. To porkoboe: Marking back as INCOMPLETE, could you please answer my questions so I could help you? Thanks a lot.
Ok, I realized, that I have to change my "Web pages folder" property to /src instead of /src/jsp to get it work. Thanks for your help.
No response from the original reporter for a long time, no duplicates as well, so closing as WORKSFORME. Please, feel free to reopen if the problem still exists and provide requested information. Thanks for reporting.