java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by Rakesh Kalra,
  • 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.
    via by Rakesh Kalra,
    • 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)
    No Bugmate found.