org.hibernate.validator.InvalidStateException: validation failed for: com.desiweb.locals.bo.BuySellRent

coderanch.com | 3 months ago
  1. 0

    What would cause an Hibernate InvalidStateException

    Stack Overflow | 6 years ago | Sam
    org.hibernate.validator.InvalidStateException: validation failed for: com.mycompany.model.User at org.hibernate.validator.event.ValidateEventListener.validate(Val idateEventListener.java:148)
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Why primefaces is not applying validation rules to components

    Stack Overflow | 2 years ago | Eric Freitas
    javax.faces.FacesException: #{usuarioMB.salvar}: org.hibernate.validator.InvalidStateException: validation failed for: edu.fae.model.Usuario
  4. 0

    My Customer class has two address (embedded), one must be validated, the other dont. When the address2 is null, the validation works. But when the empty instance is setted, the persist crashes. Validating by ClassValidator works fine. But when I call the em.persist() in service, the exception is throwed: javax.ejb.EJBException: nested exception is: org.hibernate.validator.InvalidStateException: validation failed for: br.com.kinomaxx.kinosystem.Customer org.hibernate.validator.InvalidStateException: validation failed for: br.com.kinomaxx.kinosystem.Customer at org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:148) at org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:172) at org.hibernate.action.EntityIdentityInsertAction.preInsert(EntityIdentityInsertAction.java:119) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:42) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108) at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49) at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131) at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87) at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38) at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618) at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592) at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596) at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:213) at br.com.kinomaxx.kinosystem.dao.EntityManagerWrapperBean.persist(EntityManagerWrapperBean.java:52) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:45) at org.mycontainer.jpa.PersistenceContextInterceptor.intercept(PersistenceContextInterceptor.java:53) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.kernel.interceptors.NamingInjectInterceptor.intercept(NamingInjectInterceptor.java:48) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.kernel.interceptors.NamingInjectInterceptor.intercept(NamingInjectInterceptor.java:48) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.ejb.interceptor.EJBContextInterceptor.intercept(EJBContextInterceptor.java:55) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.ejb.transaction.RequiredTransactionHandler.intercept(RequiredTransactionHandler.java:38) at org.mycontainer.ejb.interceptor.TransactionInterceptor.intercept(TransactionInterceptor.java:52) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.ejb.interceptor.EJBExceptionInterceptor.intercept(EJBExceptionInterceptor.java:27) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.kernel.reflect.proxy.ProxyEngine.invoke(ProxyEngine.java:77) at $Proxy33.persist(Unknown Source) at br.com.kinomaxx.kinosystem.CustomerTest.test(CustomerTest.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) javax.ejb.EJBException: nested exception is: org.hibernate.validator.InvalidStateException: validation failed for: br.com.kinomaxx.kinosystem.Customer at org.mycontainer.ejb.interceptor.EJBExceptionInterceptor.intercept(EJBExceptionInterceptor.java:31) at org.mycontainer.kernel.reflect.proxy.ProxyChainImpl.proceed(ProxyChainImpl.java:35) at org.mycontainer.kernel.reflect.proxy.ProxyEngine.invoke(ProxyEngine.java:77) at $Proxy33.persist(Unknown Source) at br.com.kinomaxx.kinosystem.CustomerTest.test(CustomerTest.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

    Hibernate JIRA | 8 years ago | Raoni Fortes Normanton
    org.hibernate.validator.InvalidStateException: validation failed for: br.com.kinomaxx.kinosystem.Customer

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.validator.InvalidStateException

      validation failed for: com.desiweb.locals.bo.BuySellRent

      at org.hibernate.validator.event.ValidateEventListener.validate()
    2. org.hibernate.validator
      ValidateEventListener.onPreInsert
      1. org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:148)
      2. org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:172)
      2 frames
    3. Hibernate
      EntityIdentityInsertAction.execute
      1. org.hibernate.action.EntityIdentityInsertAction.preInsert(EntityIdentityInsertAction.java:119)
      2. org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:42)
      2 frames
    4. Hibernate
      ActionQueue.execute
      1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
      1 frame
    5. Hibernate
      SessionImpl.save
      1. org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
      2. org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
      3. org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
      4. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
      5. org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
      6. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
      7. org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
      8. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
      9. org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
      10. org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
      11. org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
      11 frames
    6. Hibernate Search Engine
      FullTextSessionImpl.save
      1. org.hibernate.search.impl.FullTextSessionImpl.save(FullTextSessionImpl.java:661)
      1 frame
    7. org.jboss.seam
      HibernateSessionProxy.save
      1. org.jboss.seam.persistence.HibernateSessionProxy.save(HibernateSessionProxy.java:366)
      1 frame
    8. com.desiweb.locals
      PostAdAction.persistAd
      1. com.desiweb.locals.action.PostAdAction.persistAd(PostAdAction.java:88)
      1 frame
    9. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    10. org.jboss.seam
      JavaBeanInterceptor.invoke
      1. org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      2. org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
      3. org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      4. org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      5. org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      6. org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
      7. org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      8. org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      9. org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      10. org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      11. org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
      12. org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
      12 frames
    11. com.desiweb.locals
      PostAdAction_$$_javassist_seam_0.persistAd
      1. com.desiweb.locals.action.PostAdAction_$$_javassist_seam_0.persistAd(PostAdAction_$$_javassist_seam_0.java)
      1 frame
    12. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    13. org.jboss.el
      MethodExpressionImpl.invoke
      1. org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
      2. org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
      3. org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      4. org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      5. org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      5 frames
    14. Facelets
      TagMethodExpression.invoke
      1. com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      1 frame
    15. JavaEE 7
      MethodBindingMethodExpressionAdapter.invoke
      1. javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
      1 frame
    16. JSF
      ActionListenerImpl.processAction
      1. com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      1 frame
    17. JavaEE 7
      UICommand.broadcast
      1. javax.faces.component.UICommand.broadcast(UICommand.java:387)
      1 frame
    18. RichFaces Core API
      AjaxViewRoot.processApplication
      1. org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
      2. org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
      3. org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
      4. org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
      4 frames
    19. JSF
      LifecycleImpl.execute
      1. com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      2. com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      3. com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      3 frames
    20. JavaEE 7
      FacesServlet.service
      1. javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      1 frame
    21. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    22. org.jboss.seam
      SeamFilter$FilterChainImpl.doFilter
      1. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      2. org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      3. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      4. org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      5. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      6. org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      7. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      8. org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      9. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      9 frames
    23. org.ajax4jsf.webapp
      BaseFilter.doFilter
      1. org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      2. org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      3. org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
      4. org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
      4 frames
    24. org.jboss.seam
      SeamFilter.doFilter
      1. org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
      2. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      3. org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      4. org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      5. org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      5 frames
    25. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      9 frames
    26. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      3 frames
    27. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame