[
https://issues.jboss.org/browse/RF-12472?page=com.atlassian.jira.plugin.s...
]
Lukáš Fryč updated RF-12472:
----------------------------
Fix Version/s: 4.3.0.Milestone2
CSV + @FacesValidator generates NPE
-----------------------------------
Key: RF-12472
URL:
https://issues.jboss.org/browse/RF-12472
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: component-validators
Affects Versions: 4.3.0.Milestone1
Reporter: Bernard Labno
Assignee: Bernard Labno
Priority: Critical
Fix For: 4.3.0.Milestone2
{code:xml}<h:inputText id="i" value="#{registerView.user.email}"
required="true">
<f:validator validatorId="uniqueEmailValidator" for="i"/>
<rich:validator/>
</h:inputText>{code}
{code:java}
@FacesValidator("uniqueEmailValidator")
@RequestScoped
public class UniqueEmailValidator implements Validator {
// ------------------------------ FIELDS ------------------------------
@Inject
private BundleTemplateMessage messageBuilder;
@Inject
private UserHome userHome;
// ------------------------ INTERFACE METHODS ------------------------
// --------------------- Interface Validator ---------------------
@Override
public void validate(FacesContext context, UIComponent component, Object value)
throws ValidatorException
{
String email = (String) value;
try {
userHome.getByEmail(email);
throw new ValidatorException(new FacesMessage(
messageBuilder.key(MessageKeys.EMAIL_ALREADY_REGSITERED).defaults(MessageKeys.EMAIL_ALREADY_REGSITERED.toString()).build().getText()));
} catch (NoResultException e) {
//email is unique
}
}
}
{code}
{noformat}
java.lang.NullPointerException:
org.richfaces.validator.FacesServiceBase.fillParameters(FacesServiceBase.java:30)
org.richfaces.validator.FacesValidatorServiceImpl.fillParameters(FacesValidatorServiceImpl.java:130)
org.richfaces.validator.FacesValidatorServiceImpl.getValidatorDescription(FacesValidatorServiceImpl.java:37)
org.richfaces.component.behavior.ClientValidatorImpl.getValidators(ClientValidatorImpl.java:332)
org.richfaces.renderkit.html.ClientValidatorRenderer.createValidatorScript(ClientValidatorRenderer.java:143)
org.richfaces.renderkit.html.ClientValidatorRenderer.buildAndStoreValidatorScript(ClientValidatorRenderer.java:129)
org.richfaces.renderkit.html.ClientValidatorRenderer.getScript(ClientValidatorRenderer.java:63)
javax.faces.component.behavior.ClientBehaviorBase.getScript(ClientBehaviorBase.java:103)
org.richfaces.component.behavior.ClientValidatorImpl.getScript(ClientValidatorImpl.java:111)
com.sun.faces.renderkit.RenderKitUtils.getSingleBehaviorHandler(RenderKitUtils.java:1660)
com.sun.faces.renderkit.RenderKitUtils.renderHandler(RenderKitUtils.java:1753)
com.sun.faces.renderkit.RenderKitUtils.renderOnchange(RenderKitUtils.java:388)
com.sun.faces.renderkit.html_basic.TextRenderer.getEndTextToRender(TextRenderer.java:134)
com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:170)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
org.richfaces.renderkit.RendererBase.renderChildren(RendererBase.java:276)
org.richfaces.renderkit.html.PanelRenderer.doEncodeEnd(PanelRenderer.java:183)
org.richfaces.renderkit.RendererBase.encodeEnd(RendererBase.java:175)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:424)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
com.ocpsoft.pretty.faces.application.PrettyViewHandler.renderView(PrettyViewHandler.java:163)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:110)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:161)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397)
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
java.lang.Thread.run(Thread.java:662)
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira