2 Replies Latest reply on Feb 26, 2007 12:55 PM by Uwe Schäfer

    ajax4jsf validation in 1.1.7.rc1

    Uwe Schäfer Newbie

      hi

      something stopped working in 1.1.7. We have a simple named (non-entity or session) POJO like this:

      @Name("credentials")
      public class LoginCredentials
      {
      private String username;
      private String password;
      public LoginCredentials(){}
      @NotEmpty(message = "Bitte Passwort eingeben.")
      public String getPassword()
      {
      return password;
      }
      @NotEmpty(message = "Bitte Benutzernamen eingeben.")
      public String getUsername()
      {
      return username;
      }
      public void setPassword(String password)
      {
      this.password = password;
      }
      public void setUsername(String username)
      {
      this.username = username;
      }
      }

      We have it injected into a Seam Component like this:

      @In(required = false)
      @Valid
      private LoginCredentials credentials;

      @IfInvalid(outcome = "REFRESH")
      public String loginAction()
      {
      if (credentials == null) throw new NullPointerException("credentials");
      return loginWithCredentials(credentials) ? LoginOutcomes.OK : LoginOutcomes.FAIL;
      }

      There is a very simple facelet serving as the view:

      <s:validateAll>
      <s:decorate>
      <h:inputText id="username" value="#{credentials.username}" required="true" >
      <a:support event="onblur" reRender="usernameErrors"/>
      </h:inputText>
      <a:outputPanel id="usernameErrors">
      <s:message />
      </a:outputPanel>
      </s:decorate>
      <h:outputLabel for="password">Password</h:outputLabel>
      <s:decorate>
      <h:inputSecret id="password" value="#{credentials.password}" required="true">
      <a:support event="onblur" reRender="passwordErrors"/>
      </h:inputSecret>
      <a:outputPanel id="passwordErrors">
      <s:message />
      </a:outputPanel>
      </s:decorate>
      </s:validateAll>
      <h:messages globalOnly="true" />
      <h:commandButton action="#{Login.loginAction}" type="submit" value="Anmelden"/>

      While all of this worked out nicely in 1.1.0-1.1.6, it suddenly throws Exceptions in 1.1.7.RC1:

      15:53:08,262 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NoSuchMethodError: validate
      org.jboss.seam.ui.ModelValidator.validate(ModelValidator.java:25)
      javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:157)
      javax.faces.component.UIInput.validateValue(UIInput.java:312)
      javax.faces.component.UIInput.validate(UIInput.java:353)
      javax.faces.component.UIInput.processValidators(UIInput.java:183)
      javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:624)
      javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:624)
      javax.faces.component.UIForm.processValidators(UIForm.java:70)
      javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:624)
      javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:146)
      org.ajax4jsf.framework.ajax.AjaxViewRoot.processValidators(AjaxViewRoot.java:389)
      org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:262)
      org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.seam.servlet.SeamMultipartFilter.doFilter(SeamMultipartFilter.java:49)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
      org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

      Is there anything i could have missed in the changes document, or is there a bug/missing/misspelled code in 1.1.7 ?

      if i can provide anything more detailed in order to reproduce the situation, let me know.

      cu uwe schaefer