NullPointerException in UIInputContainer when used with h:selectBooleanCheckbox
-------------------------------------------------------------------------------
Key: SEAMFACES-160
URL:
https://issues.jboss.org/browse/SEAMFACES-160
Project: Seam Faces
Issue Type: Bug
Components: UI Components
Affects Versions: 3.0.1
Environment: JBoss AS 6
Reporter: Alt Avatar
I'm using the composite component definition from the input.xhtml in the Seam-Booking
demo. When used with an <h:selectBooleanCheckbox/> this produces a
NullPointerException in UIInputContainer.java
View template:
{{
<x:input label="Rememberme">
<h:selectBooleanCheckbox value="#{login.remember}" />
</x:input>
}}
Composite component definition:
{{
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:cc="http://java.sun.com/jsf/composite">
<cc:interface componentType="org.jboss.seam.faces.InputContainer">
<cc:attribute name="label" required="true"/>
<cc:attribute name="required" required="false"/>
<cc:attribute name="ajax" required="false"
default="false"/>
<cc:attribute name="inputs" required="false"
default="1"/>
</cc:interface>
<cc:implementation>
<div class="entry" id="#{cc.clientId}">
<h:outputLabel id="label" for=""
value="#{cc.attrs.label}:" styleClass="#{cc.attrs.invalid ? 'label
errors' : 'label'}">
<h:panelGroup styleClass="required"
rendered="#{cc.attrs.required}">*</h:panelGroup>
</h:outputLabel>
<span class="#{cc.attrs.invalid ? 'input errors' :
'input'}">
<cc:insertChildren/>
</span>
<h:panelGroup rendered="#{cc.attrs.invalid}">
<c:forEach var="i" begin="1"
end="#{cc.attrs.inputs}">
<h:message id="message#{i}" for=""
styleClass="error errors"/>
</c:forEach>
</h:panelGroup>
</div>
</cc:implementation>
</ui:composition>
}}
Stacktrace:
{{
java.lang.NullPointerException
at
org.jboss.seam.faces.component.UIInputContainer$InputContainerElements.isRequiredByConstraint(UIInputContainer.java:400)
at
org.jboss.seam.faces.component.UIInputContainer$InputContainerElements.registerInput(UIInputContainer.java:355)
at org.jboss.seam.faces.component.UIInputContainer.scan(UIInputContainer.java:244)
at org.jboss.seam.faces.component.UIInputContainer.scan(UIInputContainer.java:250)
at
org.jboss.seam.faces.component.UIInputContainer.encodeBegin(UIInputContainer.java:168)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1754)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
at
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
at
org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
at
org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
at java.lang.Thread.run(Thread.java:662)
}}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira