Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.1-Beta2
-
Component/s: ICE-Components
-
Labels:None
-
Environment:-
-
Assignee Priority:P1
Description
A user has reported the following issue when a composite component is placed on their page:
java.lang.NullPointerException
at com.icesoft.faces.component.inputrichtext.InputRichTextResourceHandler$ResourceEntry.access$500(InputRichTextResourceHandler.java:213)
at com.icesoft.faces.component.inputrichtext.InputRichTextResourceHandler.createResource(InputRichTextResourceHandler.java:174)
at com.icesoft.faces.component.inputrichtext.InputRichTextResourceHandler.createResource(InputRichTextResourceHandler.java:170)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagLibrary.getCompositeComponentResource(CompositeComponentTagLibrary.java:145)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagLibrary.containsTagHandler(CompositeComponentTagLibrary.java:121)
at com.sun.faces.facelets.tag.CompositeTagLibrary.containsTagHandler(CompositeTagLibrary.java:167)
at com.sun.faces.facelets.compiler.CompilationManager.pushTag(CompilationManager.java:295)
at com.sun.faces.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:255)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
The issue can be reproduced by adding a basic composite component to our component showcase like so:
1. Composite component source - /resources/test/mycc.xhtml
2. Component used in main-template.xhtml, I added my composite component.
The exception will be thrown as soon as you hit comp-suite/showcase.jsf URI. The user has also observed the following:
Further debugging seems to indicate that this occurs when a composite component is present on the page (which is the case in all our pages). CompositeComponentTagLibrary.getCompositeComponentResource is invoked before the PreRenderViewEvent system event gets fired. The problem does not occur if the page does not include a composite component. So to reproduce, the first page you try to access after the application is started needs to have a composite component or else the event will be fired and the problem will not occur anymore because the InputRichTextResourceHandler.codeResource will have been filled properly.
java.lang.NullPointerException
at com.icesoft.faces.component.inputrichtext.InputRichTextResourceHandler$ResourceEntry.access$500(InputRichTextResourceHandler.java:213)
at com.icesoft.faces.component.inputrichtext.InputRichTextResourceHandler.createResource(InputRichTextResourceHandler.java:174)
at com.icesoft.faces.component.inputrichtext.InputRichTextResourceHandler.createResource(InputRichTextResourceHandler.java:170)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagLibrary.getCompositeComponentResource(CompositeComponentTagLibrary.java:145)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagLibrary.containsTagHandler(CompositeComponentTagLibrary.java:121)
at com.sun.faces.facelets.tag.CompositeTagLibrary.containsTagHandler(CompositeTagLibrary.java:167)
at com.sun.faces.facelets.compiler.CompilationManager.pushTag(CompilationManager.java:295)
at com.sun.faces.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:255)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
The issue can be reproduced by adding a basic composite component to our component showcase like so:
1. Composite component source - /resources/test/mycc.xhtml
2. Component used in main-template.xhtml, I added my composite component.
The exception will be thrown as soon as you hit comp-suite/showcase.jsf URI. The user has also observed the following:
Further debugging seems to indicate that this occurs when a composite component is present on the page (which is the case in all our pages). CompositeComponentTagLibrary.getCompositeComponentResource is invoked before the PreRenderViewEvent system event gets fired. The problem does not occur if the page does not include a composite component. So to reproduce, the first page you try to access after the application is started needs to have a composite component or else the event will be fired and the problem will not occur anymore because the InputRichTextResourceHandler.codeResource will have been filled properly.
Adding the mandatoryResource configuration setting, either using the "mandatoryResourceConfiguration" context param in the web.xml, or via an
<icecore:config mandatoryResource="com.icesoft.faces.component.inputrichtext.InputRichText"/> tag on the page, has no effect on the issue.