Uploaded image for project: 'XWork'
  1. XWork
  2. XW-137

NPE thrown during execution of expressions in field expression validator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta2
    • 1.0
    • None
    • None

    Description

      NPE is thrown when a method call is attempted for a fieldexpression

      in the example below password2 is null and NPE below is thrown, but if i set password2 to some value it works fine, could any NPEs thrown be just resolved as a false expression in this case?

      <field name="password2">
      <field-validator type="fieldexpression">
      <param name="expression">password2.equals(user.password)</param>
      <message key="user.errors.passwordsDontMatch"></message>
      </field-validator>
      </field>

      [ERROR] ServletDispatcher - Could not execute action
      java.lang.NullPointerException
      at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:646)
      at ognl.ASTMethod.getValueBody(ASTMethod.java:75)
      at ognl.SimpleNode.getValue(SimpleNode.java:167)
      at ognl.ASTChain.getValueBody(ASTChain.java:109)
      at ognl.SimpleNode.getValue(SimpleNode.java:167)
      at ognl.Ognl.getValue(Ognl.java:335)
      at ognl.Ognl.getValue(Ognl.java:310)
      at com.opensymphony.xwork.util.OgnlValueStack.findValue(OgnlValueStack.java:92)
      at com.opensymphony.xwork.validator.validators.ValidatorSupport.getFieldValue(ValidatorSupport.java:90)
      at com.opensymphony.xwork.validator.validators.FieldExpressionValidator.validate(FieldExpressionValidator.java:37)
      at com.opensymphony.xwork.validator.ActionValidatorManager.validate(ActionValidatorManager.java:69)
      at com.opensymphony.xwork.validator.ActionValidatorManager.validate(ActionValidatorManager.java:55)
      at com.opensymphony.xwork.validator.ValidationInterceptor.before(ValidationInterceptor.java:36)
      at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:36)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:37)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.interceptor.TimerInterceptor.intercept(TimerInterceptor.java:62)
      at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:170)
      at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
      at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:182)
      at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:162)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
      at com.evermind._hb.doFilter(.:59)
      at com.opensymphony.webwork.lifecycle.RequestLifecycleFilter.doFilter(RequestLifecycleFilter.java:62)
      at com.evermind._ha.doFilter(.:16)
      at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(Unknown Source)
      at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(Unknown Source)
      at com.evermind._cub._pod(.:383)
      at com.evermind._cub._bmc(.:177)
      at com.evermind._ax._ltc(.:666)
      at com.evermind._ax._uab(.:191)
      at com.evermind._bf.run(.:62)

      Attachments

        Activity

          People

            plightbo Patrick Lightbody
            lagcisco Francisco Hernandez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: