We're updating the issue view to help you get more done. 

@CreditCardNumber throws PropertyNotFoundException on validation error

Description

Test an invalid credit card number:

1 2 3 4 5 6 class TestVO { @CreditCardNumber(message = "141") public String getCreditCardNumber() { return "4411111111111"; } }

Usage:

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

Result:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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)

Environment

Java 1.7, Win7, Eclipse

Status

Assignee

Hardy Ferentschik

Reporter

member sound

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.1.0.Final

Priority

Major