[
http://opensource.atlassian.com/projects/hibernate/browse/HV-7?page=all ]
Emmanuel Bernard moved ANN-511 to HV-7:
---------------------------------------
Version: (was: 3.2.1)
Bundle 3.2.1
Fix Version: (was: 3.2.2)
FIRST
Component: (was: validator)
engine
Key: HV-7 (was: ANN-511)
Project: Hibernate Validator (was: Hibernate Annotations)
Two level @Valid annotation doesn't work
-----------------------------------------
Key: HV-7
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-7
Project: Hibernate Validator
Type: Bug
Components: engine
Versions: Bundle 3.2.1
Environment: hibernate-annotations 3.2.1.ga
Reporter: Rakesh Kalra
Assignee: Emmanuel Bernard
Fix For: FIRST
Original Estimate: 1 hour
Remaining: 1 hour
I have object depth of 3: Form, Member, Address. I get the following exception when
initializing ClassValidator:
java.lang.NullPointerException
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:142)
at
org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:252)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:149)
at
org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:252)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:134)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
...
This works fine with 3.2.0.ga.
I think the problem is in the following constructor, where instance level
"reflectionManager" is not being initialized.
protected ClassValidator(
XClass beanXClass, ResourceBundle resourceBundle, MessageInterpolator
userInterpolator,
Map<XClass, ClassValidator> childClassValidators, ReflectionManager
reflectionManager
) {
this.beanClass = reflectionManager.toClass( beanXClass );
this.messageBundle = resourceBundle == null ?
getDefaultResourceBundle() :
resourceBundle;
this.defaultMessageBundle = ResourceBundle.getBundle( DEFAULT_VALIDATOR_MESSAGE );
this.userInterpolator = userInterpolator;
this.childClassValidators = childClassValidators;
initValidator( beanXClass, childClassValidators );
}
The other constructor initializes reflectionManager.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira