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 121406 - Nullpointer Exception when clicking on a EL expression
Summary: Nullpointer Exception when clicking on a EL expression
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: _ potingwu
URL:
Keywords:
Depends on: 116418
Blocks:
  Show dependency tree
 
Reported: 2007-11-07 18:39 UTC by fincatto
Modified: 2008-03-21 17:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fincatto 2007-11-07 18:39:45 UTC
When clicking in a EL expression (JSF app), the IDE reports a nullpointer exception:

java.lang.NullPointerException
at org.netbeans.modules.web.jsf.editor.jspel.JSFBeanCache.getBeans(JSFBeanCache.java:66)
at org.netbeans.modules.web.jsf.editor.jspel.JSFELExpression.findContext(JSFELExpression.java:89)
at org.netbeans.modules.web.core.syntax.completion.ELExpression.parse(ELExpression.java:195)
at org.netbeans.modules.web.jsf.editor.jspel.JSFJSPHyperlinkProvider.isHyperlinkPoint(JSFJSPHyperlinkProvider.java:140)
at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.findProvider(HyperlinkOperation.java:279)
at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performHyperlinking(HyperlinkOperation.java:227)
at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseMoved(HyperlinkOperation.java:212)
at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseMotionEvent(Component.java:5599)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
at java.awt.Component.processEvent(Component.java:5323)
at java.awt.Container.processEvent(Container.java:2010)
at java.awt.Component.dispatchEventImpl(Component.java:4021)
at java.awt.Container.dispatchEventImpl(Container.java:2068)
at java.awt.Component.dispatchEvent(Component.java:3869)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3949)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866)
at java.awt.Container.dispatchEventImpl(Container.java:2054)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3869)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

And does not follow the link. When opening the same app/jsp in NB 5.5.1, the editor opens the desired class and go to
the correct method.
Comment 1 Petr Pisl 2007-11-08 10:04:15 UTC
Which build do you use? Please write a build number. I fixed this similar NPE at 18th October. It should be already fixed.  
Comment 2 fincatto 2007-11-08 10:28:18 UTC
I'm using NetBeans beta2. I downloading the daily build to try. Thanks.
Comment 3 fincatto 2007-11-08 11:32:26 UTC
The bug persists on the daily build (200711071200)

java.lang.NullPointerException
	at org.netbeans.modules.web.jsf.editor.jspel.JSFBeanCache.getBeans(JSFBeanCache.java:74)
	at org.netbeans.modules.web.jsf.editor.jspel.JSFELExpression.findContext(JSFELExpression.java:103)
	at org.netbeans.modules.web.core.syntax.completion.ELExpression.parse(ELExpression.java:195)
	at org.netbeans.modules.web.jsf.editor.jspel.JSFJSPHyperlinkProvider.isHyperlinkPoint(JSFJSPHyperlinkProvider.java:138)
	at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.findProvider(HyperlinkOperation.java:282)
	at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.performHyperlinking(HyperlinkOperation.java:230)
	at org.netbeans.lib.editor.hyperlink.HyperlinkOperation.mouseMoved(HyperlinkOperation.java:215)
	at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:272)
	at java.awt.Component.processMouseMotionEvent(Component.java:5562)
	at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3153)
	at java.awt.Component.processEvent(Component.java:5286)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3984)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3819)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1791)
	at java.awt.Component.dispatchEvent(Component.java:3819)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

Comment 4 Petr Pisl 2007-11-08 14:02:57 UTC
Thanks, now it's different stacktrace. 
Comment 5 fincatto 2007-11-14 18:20:57 UTC
In the new version of NB (6.0 RC1), when i sent a issue report, it was identified duplicated of
http://www.netbeans.org/issues/show_bug.cgi?id=115182
Comment 6 fincatto 2007-11-14 19:07:23 UTC
The problem occurs when the root node of config file is:
<faces-config xmlns="http://java.sun.com/JSF/Configuration">

Changing to <faces-config> solve this problem!

It should be nice if a hint (bullet) is shown when this situation occurs.
Thanks 
Comment 7 Petr Pisl 2007-11-15 17:26:58 UTC
Aha, probably I now where is the problem. Is your file valid? I mean, when you hit validation button in the toolbar,
does it pass? The problem probably is that the JSFBeansCache rely that all the configuration files are valid and there
is a model in memory for them. Unfortunately, when a jsf configuration file is not valid, we are not able to parse it
and then there is not model in memory.

I'm reopening this issue and will look at this.
Comment 8 pinheiro 2007-11-28 11:28:20 UTC
I've curious about this, since I had the same problem, and verified my XML when using "<faces-config
xmlns="http://java.sun.com/JSF/Configuration">":

XML checking started.
Checking file:/Users/fernando/Biblioteca/Fontes/jBear/web/WEB-INF/managedbeanspaginas.xml...
XML checking finished.

XML validation started.
Checking file:/Users/fernando/Biblioteca/Fontes/jBear/web/WEB-INF/managedbeanspaginas.xml...
XML validation finished.

No errors were appointed, although I cannot navigate from JSP to source code (NPE).
Comment 9 _ potingwu 2008-03-21 17:24:32 UTC
As discussed with Petr Pisl, the solution should follow xml specification. Which means that if there is an element
defining a namespace, then all subelements without a namespace has the same. Therefore, we will always use the namepsace
that appears in the <faces-config> for the comparison. I.e., the getQName() method has been restructured.

    changeset a4c7ae2ae10c in main
    details: http://hg.netbeans.org/main?cmd=changeset;node=a4c7ae2ae10c

    changeset 3ce9b72283dd in main
    details: http://hg.netbeans.org/main?cmd=changeset;node=3ce9b72283dd

Please see also issue#116418.