javax.validation.ConstraintViolationException

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.

  • Working on a project with the following: [code] persistence setup --provider HIBERNATE --database ORACLE entity --class ~.ItemStatus field string --fieldName name --notNull entity --class ~.ItemState --testAutomatically field reference --type ~.ItemStatus status --cardinality ONE_TO_ONE --notNull field date --type java.util.Date --fieldName statusDate --notNull field boolean --fieldName currentState --notNull [/code] When I run a mvn compile, I get a notice about failed tests, with the following result: [code] ------------------------------------------------------------------------------- Test set: test.ItemStateIntegrationTest ------------------------------------------------------------------------------- Tests run: 9, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.077 sec <<< FAILURE! testFlush(test.ItemStateIntegrationTest) Time elapsed: 0.014 sec <<< ERROR! javax.validation.ConstraintViolationException: Validation failed for classes [test.ItemState] during persist time for groups [javax.validation.groups.Default, ] List of constraint violations:[ ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=status, rootBeanClass=class test.ItemState, messageTemplate='{javax.validation.constraints.NotNull.message}'} ] at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:161) at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreInsert(BeanValidationEventListener.java:94) at org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:178) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:72) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) ... [/code]
    via by Kyle McCaffrey,
  • Working on a project with the following: [code] persistence setup --provider HIBERNATE --database ORACLE entity --class ~.ItemStatus field string --fieldName name --notNull entity --class ~.ItemState --testAutomatically field reference --type ~.ItemStatus status --cardinality ONE_TO_ONE --notNull field date --type java.util.Date --fieldName statusDate --notNull field boolean --fieldName currentState --notNull [/code] When I run a mvn compile, I get a notice about failed tests, with the following result: [code] ------------------------------------------------------------------------------- Test set: test.ItemStateIntegrationTest ------------------------------------------------------------------------------- Tests run: 9, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.077 sec <<< FAILURE! testFlush(test.ItemStateIntegrationTest) Time elapsed: 0.014 sec <<< ERROR! javax.validation.ConstraintViolationException: Validation failed for classes [test.ItemState] during persist time for groups [javax.validation.groups.Default, ] List of constraint violations:[ ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=status, rootBeanClass=class test.ItemState, messageTemplate='{javax.validation.constraints.NotNull.message}'} ] at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:161) at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreInsert(BeanValidationEventListener.java:94) at org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:178) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:72) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216) ... [/code]
    via by Kyle McCaffrey,
  • Hibenate Validator 4.1 - Assuntos Gerais - GUJ
    via by Unknown author,
    • javax.validation.ConstraintViolationException: Validation failed for classes [test.ItemState] during persist time for groups [javax.validation.groups.Default, ] List of constraint violations:[ ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=status, rootBeanClass=class test.ItemState, messageTemplate='{javax.validation.constraints.NotNull.message}'} ] at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:161) at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreInsert(BeanValidationEventListener.java:94) at org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:178) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:72) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    tomthomastomthomas
    3 times, last one,
    dafmandafman
    2 times, last one,
    12 more bugmates