| Summary: | [JSF2.0] NPE when TagAnalyzer tries to instantiate a new instance of a Faces Tag that depends on the FacesContext | ||
|---|---|---|---|
| Product: | [WebTools] Java Server Faces | Reporter: | Carlin Rogers <carlin.rogers> |
| Component: | Core | Assignee: | Ian Trimble <ian.trimble> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | cameron.bateman, ian.trimble, raghunathan.srinivasan |
| Version: | 3.2 | ||
| Target Milestone: | Future | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
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. 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. Not planned for Juno |
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)