Uploaded image for project: 'Hibernate Validator'
  1. HV-881

@CreditCardNumber throws PropertyNotFoundException on validation error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.Final
    • Fix Version/s: 5.2.0.Alpha1
    • Component/s: engine, validators
    • Labels:
      None
    • Environment:
      Java 1.7, Win7, Eclipse
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      Test an invalid credit card number:

      class TestVO {
      	@CreditCardNumber(message = "141")
      	public String getCreditCardNumber() {
      		return "4411111111111";
      	}
      }
      

      Usage:

      Validation.buildDefaultValidatorFactory().getValidator().validate(new TestVO());
      

      Result:

      Mrz 20, 2014 3:20:03 PM org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm interpolateExpressionLanguageTerm
      WARN: HV000129: EL expression '${value}' references an unknown property
      javax.el.PropertyNotFoundException: Cannot find property value
      	at org.hibernate.validator.internal.engine.messageinterpolation.el.RootResolver.getValue(RootResolver.java:64)
      	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
      	at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:99)
      	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
      	at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.interpolateExpressionLanguageTerm(InterpolationTerm.java:112)
      	at org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.interpolate(InterpolationTerm.java:90)
      	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateExpression(ResourceBundleMessageInterpolator.java:342)
      	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateMessage(ResourceBundleMessageInterpolator.java:298)
      	at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolate(ResourceBundleMessageInterpolator.java:182)
      	at org.hibernate.validator.internal.engine.ValidationContext.interpolate(ValidationContext.java:362)
      	at org.hibernate.validator.internal.engine.ValidationContext.createConstraintViolation(ValidationContext.java:271)
      	at org.hibernate.validator.internal.engine.ValidationContext.createConstraintViolations(ValidationContext.java:232)
      	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:291)
      	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133)
      	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233)
      	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:102)
      	at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91)
      	at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:84)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:525)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:465)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:429)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:381)
      	at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:184)
      	at de.test.test.RunTest.main(RunTest.java:8)
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: