[
http://opensource.atlassian.com/projects/hibernate/browse/HV-266?page=com...
]
Marcus Brito updated HV-266:
----------------------------
Attachment: UsuarioChaveValidator.java
UsuarioChave.java
Usuario.java
Here's all (I think) relevant files. The annotated bean, a custom constraint and
it's validator.
I'm using Hibernate Validator 4.0.1.GA and Hibernate 3.5.0.Beta-1.
NullPointerException when trying to validate an object with a
class-level constraint annotation.
------------------------------------------------------------------------------------------------
Key: HV-266
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-266
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.0.1.GA
Reporter: Marcus Brito
Assignee: Hardy Ferentschik
Attachments: Usuario.java, UsuarioChave.java, UsuarioChaveValidator.java
The JPATraversableResolver seems to fumble when passed a property path of ""
(constraint on root bean class):
{code}
java.lang.NullPointerException
at java.lang.Class.searchFields(Class.java:2599)
at java.lang.Class.getField0(Class.java:2618)
at java.lang.Class.getField(Class.java:1518)
at org.hibernate.ejb.util.PersistenceUtilHelper.get(PersistenceUtilHelper.java:84)
at
org.hibernate.ejb.util.PersistenceUtilHelper.isLoadedWithReference(PersistenceUtilHelper.java:76)
at
org.hibernate.ejb.HibernatePersistence.isLoadedWithReference(HibernatePersistence.java:178)
at javax.persistence.Persistence$1.isLoaded(Persistence.java:81)
at
org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:33)
at
org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:112)
at
org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:47)
at
org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:764)
at
org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:331)
at
org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278)
at
org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260)
at
org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213)
at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
{code}
--
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