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 128818 - Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support)
Summary: Exception: JSP syntax coloring cannot find any provider of context (this is e...
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Skrivanek
URL: http://statistics.netbeans.org/except...
Keywords:
: 138215 150379 152496 152500 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-02-29 13:08 UTC by Tomas Mysik
Modified: 2009-10-06 22:44 UTC (History)
19 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 18833


Attachments
stacktrace (2.22 KB, text/plain)
2008-02-29 13:08 UTC, Tomas Mysik
Details
stacktrace (2.22 KB, text/plain)
2008-03-19 13:50 UTC, Jindrich Sedek
Details
stacktrace (2.22 KB, text/plain)
2008-04-03 20:42 UTC, fernando_martines
Details
stacktrace (2.22 KB, text/plain)
2008-04-07 19:02 UTC, jpleed3
Details
stacktrace (2.22 KB, text/plain)
2008-04-08 14:31 UTC, fernando_martines
Details
stacktrace (2.22 KB, text/plain)
2008-04-23 15:58 UTC, Tomas Mysik
Details
stacktrace (133 bytes, text/plain)
2008-07-31 17:17 UTC, sunbiz
Details
stacktrace (2.22 KB, text/plain)
2008-07-31 17:17 UTC, sunbiz
Details
stacktrace (2.22 KB, text/plain)
2008-08-02 00:51 UTC, big_al
Details
stacktrace (2.22 KB, text/plain)
2008-08-28 15:39 UTC, ualex
Details
stacktrace (2.22 KB, text/plain)
2008-08-28 20:11 UTC, ualex
Details
stacktrace (3.52 KB, text/plain)
2008-09-11 09:52 UTC, Martin Fousek
Details
stacktrace (3.38 KB, text/plain)
2008-09-12 14:43 UTC, gholmer
Details
stacktrace (3.04 KB, text/plain)
2009-04-30 20:10 UTC, completeman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Mysik 2008-02-29 13:08:15 UTC
Build: NetBeans IDE Dev (Build 080229)
VM: Java HotSpot(TM) Client VM, 1.5.0_14-b03
OS: Linux, 2.6.24-gentoo-r3, i386

User Comments: 
- create JSP page in WEB-INF folder
- drag & drop it into web folder
Comment 1 Tomas Mysik 2008-02-29 13:08:22 UTC
Created attachment 57534 [details]
stacktrace
Comment 2 Exceptions Reporter 2008-03-18 18:15:15 UTC
This issue has already 10 duplicates 
Comment 3 Jindrich Sedek 2008-03-19 13:50:48 UTC
Build: NetBeans IDE Dev (Build 200803171203)
VM: Java HotSpot(TM) Client VM, 1.6.0_10-ea-b07
OS: SunOS, 5.11, x86

User Comments: 
I had open jspf file and few other files. This exception rised while I were switching editor focus to the jspf file pane.
Comment 4 Jindrich Sedek 2008-03-19 13:50:51 UTC
Created attachment 58655 [details]
stacktrace
Comment 5 fernando_martines 2008-04-03 20:42:34 UTC
Build: NetBeans IDE 6.1 Beta (Build 200803050202)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 6 fernando_martines 2008-04-03 20:42:37 UTC
Created attachment 59646 [details]
stacktrace
Comment 7 jpleed3 2008-04-07 19:02:20 UTC
Build: NetBeans IDE Dev (Build 200804030004)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06, Java(TM) SE Runtime Environment, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments: 
Switching editor tab to JSP page. This happened a lot when I open up .jsp files but I usually use JSP documents so it's not that big of a deal
Comment 8 jpleed3 2008-04-07 19:02:30 UTC
Created attachment 59794 [details]
stacktrace
Comment 9 fernando_martines 2008-04-08 14:31:35 UTC
Build: NetBeans IDE 6.1 Beta (Build 200803050202)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 10 fernando_martines 2008-04-08 14:31:43 UTC
Created attachment 59840 [details]
stacktrace
Comment 11 Exceptions Reporter 2008-04-18 08:43:18 UTC
This issue has already 20 duplicates 
Comment 12 Tomas Mysik 2008-04-23 15:58:05 UTC
Build: NetBeans IDE Dev (Build 080423)
VM: Java HotSpot(TM) Client VM, 1.5.0_15-b04, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_15-b04
OS: Linux, 2.6.25-gentoo-r1, i386

User Comments: 
- create header.jspf in /WEB-INF
- drag&drop header.jspf under the Web Pages node
=> exception
Comment 13 Tomas Mysik 2008-04-23 15:58:09 UTC
Created attachment 60610 [details]
stacktrace
Comment 14 Exceptions Reporter 2008-05-16 03:14:49 UTC
This issue has already 50 duplicates 
Comment 15 sunbiz 2008-07-31 17:17:32 UTC
Build: NetBeans IDE Dev (Build 080731)
VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Windows Vista, 6.0, x86

User Comments: 
Editing JSP file

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support)
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:117)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:129)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:211)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.processIncludes(SimplifiedJSPServlet.java:262)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.process(SimplifiedJSPServlet.java:184)
Comment 16 sunbiz 2008-07-31 17:17:40 UTC
Created attachment 66191 [details]
stacktrace
Comment 17 sunbiz 2008-07-31 17:17:47 UTC
Created attachment 66192 [details]
stacktrace
Comment 18 big_al 2008-08-02 00:51:07 UTC
Build: NetBeans IDE Dev (Build 200807310201)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12
OS: Windows XP, 5.1, x86

User Comments: 
Deleted a directory and opened a JSP file

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support)
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:117)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:129)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:211)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.processIncludes(SimplifiedJSPServlet.java:262)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.process(SimplifiedJSPServlet.java:184)
Comment 19 big_al 2008-08-02 00:51:11 UTC
Created attachment 66370 [details]
stacktrace
Comment 20 Marian Mirilovic 2008-08-28 14:55:18 UTC
209 duplicates so far ...
Comment 21 Marek Fukala 2008-08-28 15:23:47 UTC
I'll take a deeper look at it. Thanks for reminding me.
Comment 22 ualex 2008-08-28 15:39:02 UTC
Build: NetBeans IDE Dev (Build 200808261401)
VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Windows Vista, 6.0, x86

User Comments: 
when editing jsp file

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support)
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:117)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:129)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:210)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.processIncludes(SimplifiedJSPServlet.java:262)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.process(SimplifiedJSPServlet.java:184)
Comment 23 ualex 2008-08-28 15:39:07 UTC
Created attachment 68539 [details]
stacktrace
Comment 24 Marek Fukala 2008-08-28 16:23:22 UTC
It looks like there isn't an instance of JspContextInfo registered in the filesystem in folder
J2EE/JSPSyntaxColoring/<the passed fileobject mimetype>.

For text/x-jsp and text/x-tag we provide our own impl delegating to the jsp parser. For other mimetypes it is up to the
lang. support provider.

For now I have improved the exception so its message contains information about the passed fileobject and its mimetype.
Then, one someonw reports the issue on a build with the fix, we can investigate more.

Possible solution would be a fallback to the default jsp parser based implementation, but I would prefer to know the
real reason first.

I'll do the fallback + logging of the errorneous state if noone reports the issue on lastest build in a week.

changeset:   98760:4334ef9aa4e6
tag:         tip
user:        Marek Fukala <mfukala@netbeans.org>
date:        Thu Aug 28 17:17:07 2008 +0200
summary:     better logging for #128818
Comment 25 ualex 2008-08-28 20:11:10 UTC
Build: NetBeans IDE 6.5 Beta (Build 200808111757)
VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Windows Vista, 6.0, x86

User Comments: 
when open jsp file

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support)
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:117)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:129)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:211)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.processIncludes(SimplifiedJSPServlet.java:262)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.process(SimplifiedJSPServlet.java:184)
Comment 26 ualex 2008-08-28 20:11:19 UTC
Created attachment 68574 [details]
stacktrace
Comment 27 Marek Fukala 2008-09-08 10:53:39 UTC
*** Issue 138215 has been marked as a duplicate of this issue. ***
Comment 28 Martin Fousek 2008-09-11 09:52:31 UTC
Build: NetBeans IDE Dev (Build 080911)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b30
OS: Windows XP, 5.1, x86

User Comments: 
1, create WebProject
2, create any jsp file in web/WEB-INF
3, drag and drop this file into Web Pages

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support); instance path = /J2EE/JSPSyntaxColoring/content/unknown; fileObject = C:/Documents and Settings/Administrator/My Documents/NetBeansProjects/EnterpriseApplication5/EnterpriseApplication5-war/web/WEB-INF/js.jsp
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:117)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:129)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:210)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.processIncludes(SimplifiedJSPServlet.java:265)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.process(SimplifiedJSPServlet.java:187)
Comment 29 Martin Fousek 2008-09-11 09:52:35 UTC
Created attachment 69624 [details]
stacktrace
Comment 30 gholmer 2008-09-12 14:43:04 UTC
Build: NetBeans IDE Dev (Build 200809120201)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b28
OS: Linux, 2.6.24-19-generic, i386

User Comments: 
editing a Facelets template (XHTML) in WEB-INF/templates

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support); instance path = /J2EE/JSPSyntaxColoring/content/unknown; fileObject = mnt/common/netbeans/phoenix/phoenix-war/web/templates/mainTemplate.xhtml
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:117)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:129)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:210)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getPrefixMapper(JspSyntaxSupport.java:220)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getTagLibrary(JspSyntaxSupport.java:277)
Comment 31 gholmer 2008-09-12 14:43:08 UTC
Created attachment 69755 [details]
stacktrace
Comment 32 Marek Fukala 2008-09-12 14:58:40 UTC
I can reproduce the problem with dragging and dropping the file node if the file is opened in editor. Thanks.
Comment 33 Marek Fukala 2008-09-12 17:26:55 UTC
At least partially fixed the problem. JspSyntaxSupport holds a reference its document fileobject. When the file is moved
or somehow else invalidated and the document still exists the invalid fileobject may be passed to the
JspContextInfo.getContextInfo() which will then throw the exception since the invalidate fileobject mimetype is
content/unknown.

The fix ensures the fileobject backing up the document is always fresh or null.

The fix mainly solves the reports where SimplifiedJSPServlets plays its role. 

I am not completely sure if the other reports (e.g. editing a Facelets template (XHTML) in WEB-INF/templates) are the
same case.

I'll close the issue and we will see if anyone again complains about the problem (will be in fact different issue that
the one just fixed, but with similar effect).

changeset:   101459:5ce74cb5ccd8
tag:         tip
user:        Marek Fukala <mfukala@netbeans.org>
date:        Fri Sep 12 18:19:00 2008 +0200
summary:     #128818 - Exception: JSP syntax coloring cannot find any provider of context (this is expected to be
provided by web module support)
Comment 34 Quality Engineering 2008-09-13 05:28:02 UTC
Integrated into 'main-golden', will be available in build *200809130201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5ce74cb5ccd8
User: Marek Fukala <mfukala@netbeans.org>
Log: #128818 - Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support)
Comment 35 Exceptions Reporter 2008-10-16 14:05:32 UTC
Reopening - reproduced in NetBeans IDE Dev (Build 200810160201)
http://statistics.netbeans.org/exceptions/detail.do?id=128908
Comment 36 Marek Fukala 2008-10-16 14:29:29 UTC
rajivderas, did you do some changes in resolving mimetypes? Can you please specify what did you do when the exception
appeared? From the error message it is clear that your .jsp file is resolved to text/xml mimetype. 
Comment 37 rajivderas 2008-10-16 14:32:06 UTC
i went to the jsp file property pallet and entered */ in to the name field property then i came to the jsp editor and 
tried to format the file and boom
Comment 38 Marek Fukala 2008-10-16 16:07:00 UTC
thanks, I can reproduce the issue now.
1) open a JSP file
2) open properties window
3) select name property
4) type */ and press enter
=> the file name is changed to .jsp
=> the reported exception is thrown
=> the file has text/xml mimetype
=> no jsp features works

Lowering the priority since the scenario is pretty uncommon.

As I can see it, there are several problems:
1) the property value accepts */ value and then incorrectly renames the file
2) the mime resolved doesn't resolve the file properly even the extension is jsp


Comment 39 Marek Fukala 2008-10-17 08:18:53 UTC
*** Issue 150379 has been marked as a duplicate of this issue. ***
Comment 40 Marek Fukala 2008-11-19 11:52:15 UTC
*** Issue 152496 has been marked as a duplicate of this issue. ***
Comment 41 Marek Fukala 2008-11-19 11:52:58 UTC
*** Issue 152500 has been marked as a duplicate of this issue. ***
Comment 42 Jindrich Sedek 2008-11-25 12:18:48 UTC
this issue should not be marked as INCOMPLETE no more. 

I'm affraid with so many duplicates it is not an "uncommon" scenario - probably there are more ways how to reproduce 
the problem
Comment 43 Marek Fukala 2008-11-25 13:45:55 UTC
IMHO the problem is in the property editor allowing the simple slash as a new value. Then the file becomes .<extension>
so the extenstion is not considered as extension but as a filename. FileObject's mimetype then changes to
content/unknown and many features stops working besides the file becomes hidden in the explorer views.
Comment 44 Jiri Skrivanek 2008-12-06 08:54:17 UTC
I added a check to avoid slashes in filename for rename. I also added Utilities.isJavaIdentifier check to
JspDataObject.handleRename. Please, review if it is appropriate.

http://hg.netbeans.org/core-main/rev/bfae38163bea
Comment 45 Quality Engineering 2008-12-07 05:29:15 UTC
Integrated into 'main-golden', will be available in build *200812070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bfae38163bea
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #128818 - Avoid rename for invalid names.
Comment 46 completeman 2009-04-30 20:09:51 UTC
This issue was originally marked as duplicate of issue 128818, that is already fixed. This issue is still valid, so this seems to be another issue, but it might be related.

Build: NetBeans IDE Dev (Build 200904011705)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

User Comments: 
moving a jsp file to WEB-INF/jsp

Stacktrace: 
java.lang.Exception: JSP syntax coloring cannot find any provider of context (this is expected to be provided by web module support); instance path = /J2EE/JSPSyntaxColoring/content/unknown; fileObject = D:/manthan/WebApplication1/web/helloView.jsp
        at org.netbeans.modules.web.core.syntax.spi.JspContextInfo.getContextInfo(JspContextInfo.java:114)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:165)
        at org.netbeans.modules.web.core.syntax.JspUtils.getCachedParseResult(JspUtils.java:177)
        at org.netbeans.modules.web.core.syntax.JspSyntaxSupport.getParseResult(JspSyntaxSupport.java:220)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.processIncludes(SimplifiedJSPServlet.java:263)
        at org.netbeans.modules.web.core.syntax.SimplifiedJSPServlet.process(SimplifiedJSPServlet.java:189)
Comment 47 completeman 2009-04-30 20:10:01 UTC
Created attachment 81346 [details]
stacktrace