java.lang.NullPointerException

Hibernate JIRA | Rakesh Kalra | 1 decade ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    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.

    Hibernate JIRA | 1 decade ago | Rakesh Kalra
    java.lang.NullPointerException
  2. 0

    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.

    Hibernate JIRA | 1 decade ago | Rakesh Kalra
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.validator.ClassValidator.<init>()
    2. Hibernate Validator Engine
      ClassValidator.<init>
      1. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:142)
      2. org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:252)
      3. org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
      4. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:149)
      5. org.hibernate.validator.ClassValidator.createChildValidator(ClassValidator.java:252)
      6. org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:216)
      7. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:134)
      8. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:105)
      9. org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:97)
      9 frames