Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312936 - [JSF2.0] NPE when TagAnalyzer tries to instantiate a new instance of a Faces Tag that depends on the FacesContext
Summary: [JSF2.0] NPE when TagAnalyzer tries to instantiate a new instance of a Faces ...
Status: NEW
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Ian Trimble CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 12:13 EDT by Carlin Rogers CLA
Modified: 2012-01-05 12:54 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlin Rogers CLA 2010-05-14 12:13:23 EDT
The following stack trace shows an NPE when the TagAnalyzer tries to instantiate a new instance of the RegexValidatorTag from the Mojarra faces ext tag lib. There is a new implementation of RegexValidatorTag in Glassfish  JSF 2.0 that depends on the FacesContext. The original implamentation, com.sun.faces.ext.taglib.RegexValidatorTag has been replaced with com.sun.faces.taglib.jsf_core.RegexValidatorTag and its constructor makes a call to get an ExpressionFactory via a FacesContext. However, in this scenario, the context is null, causing the NPE.

This will reproduce when tusing the flush cache button in the 'JavaServer Faces | Tag Registry' View.

java.lang.NullPointerException
    at com.sun.faces.taglib.jsf_core.RegexValidatorTag.<init>(RegexValidatorTag.java:70)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at org.eclipse.jem.internal.proxy.ide.IDEStandardBeanProxyFactory.createBeanProxy(IDEStandardBeanProxyFactory.java:211)
    at org.eclipse.jem.internal.proxy.ide.IDEBeanTypeProxy.newInstance(IDEBeanTypeProxy.java:350)
    at org.eclipse.jst.jsf.core.internal.jem.BeanProxyUtil$BeanProxyWrapper.init(BeanProxyUtil.java:73)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer.TagAnalyzer.findValidatorType(TagAnalyzer.java:414)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer.TagAnalyzer.createValidatorTagElement(TagAnalyzer.java:746)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.analyzer.TagAnalyzer.createTLDTagElement(TagAnalyzer.java:640)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TagIntrospectingStrategy.resolve(TagIntrospectingStrategy.java:69)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.JSPTagResolvingStrategy.resolve(JSPTagResolvingStrategy.java:1)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.AbstractTagResolvingStrategy.perform(AbstractTagResolvingStrategy.java:42)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.AbstractTagResolvingStrategy.perform(AbstractTagResolvingStrategy.java:1)
    at org.eclipse.jst.jsf.common.internal.strategy.StrategyComposite$DefaultCompositionStrategy.compose(StrategyComposite.java:180)
    at org.eclipse.jst.jsf.common.internal.strategy.StrategyComposite.perform(StrategyComposite.java:66)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.CompositeTagResolvingStrategy.resolve(CompositeTagResolvingStrategy.java:64)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace$DocumentTLDNamespaceData.createTagElement(TLDNamespace.java:162)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace$DocumentTLDNamespaceData.getViewElement(TLDNamespace.java:206)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace$DocumentTLDNamespaceData.getAllViewElements(TLDNamespace.java:188)
    at org.eclipse.jst.jsf.designtime.internal.view.model.jsp.TLDNamespace.getViewElements(TLDNamespace.java:84)
    at org.eclipse.jst.jsf.ui.internal.tagregistry.TaglibContentProvider$1.run(TaglibContentProvider.java:170)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Carlin Rogers CLA 2010-05-14 14:10:31 EDT
Just adding a note that the stack trace below is dumped to the log as a warning only by JEM. However, the proxy instance in the BeanProxyWrapper is null after the call to initialize a proxied instance. There were no further errors in the log but a call that matched on a method name of "doStartTag" or "createValidator" would cause a failure within the TagAnalyzer when it tries to invoke the method.
Comment 2 Carlin Rogers CLA 2010-05-18 13:13:57 EDT
Pushing this out to "Future". The issue is worked around temporarily by disabling the TagIntrospectingStrategy in the default list of strategies. This default list is used when there are no values contained in the preference store. See bug 312954.

Once we resolve some of the tag introspection issues, we should re-enable the TagIntrospectingStrategy, reverting the change for bug 312954.
Comment 3 Raghunathan Srinivasan CLA 2012-01-05 12:54:37 EST
Not planned for Juno