You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Juan Miguel Rodriguez Martin <ju...@gmail.com> on 2011/03/02 12:39:06 UTC

throws java.lang.NullPointerException: expr

Hi guys,

First of all, sorry for my poor English.

I'm new to Myfaces world and I'm trying to learn from the examples in
the getting started section.
I managed to deploy the war files in the examples zip using a tomcat
6.0.30 server and Windows XP sp3.

All examples were working with no issues until I reached the
myfaces-example-simple20-1.1.10/validate.jsf example.

I don't know why but the <t:validateEqual> tag is throwing this exception:

javax.faces.FacesException: java.lang.NullPointerException: expr
	at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
	at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:191)
	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:392)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1600)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException: expr
	at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:559)
	at org.apache.myfaces.custom.equalvalidator.AbstractEqualValidator.validate(AbstractEqualValidator.java:85)
	at javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:173)
	at javax.faces.component.UIInput.validateValue(UIInput.java:429)
	at javax.faces.component.UIInput.validate(UIInput.java:574)
	at javax.faces.component.UIInput.processValidators(UIInput.java:244)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIForm.processValidators(UIForm.java:137)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIViewRoot._processValidatorsDefault(UIViewRoot.java:1290)
	at javax.faces.component.UIViewRoot.access$500(UIViewRoot.java:73)
	at javax.faces.component.UIViewRoot$ProcessValidatorPhaseProcessor.process(UIViewRoot.java:1337)
	at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1246)
	at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:722)
	at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:34)
	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
	... 17 more

I have attached the validate.png image (it's the page's view) and the
code for this validation.
<h:outputLabel for="equal" value="#{example_messages['validate_equal']}"/>
<h:inputText id="equal" value="#{validateForm.equal}" required="true"/>
<t:message id="equalError" for="equal" styleClass="error"/>

<h:inputText id="equal2" value="#{validateForm.equal2}" required="true">
         <t:validateEqual for="equal" summaryMessage='#{"Value {0}
should equal {1}"}' detailMessage='#{"The value of this field, {0},
should equal the value of that other field, {1}"}'/>
</h:inputText>
<t:message id="equal2Error" for="equal2" styleClass="error"/>
<h:outputLabel for="equal2" value="#{example_messages['validate_equal']}2"/>

Thanks in advance.