[jboss-user] [JBoss Seam] - Hibernate Validation issue

Andre1001 do-not-reply at jboss.com
Tue Sep 12 21:10:55 EDT 2006


Hi,

I'm getting this error when I try to update my bean with an invalid parameter:


  | 21:40:19,953 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
  | javax.servlet.ServletException: Could not commit transaction
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 	at java.lang.Thread.run(Thread.java:595)
  | 21:40:19,953 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
  | java.lang.IllegalStateException: Could not commit transaction
  | 	at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.commitOrRollback(SeamExtendedManagedPersistencePhaseListener.java:98)
  | 	at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.afterPhase(SeamExtendedManagedPersistencePhaseListener.java:52)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:318)
  | 	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
  | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
  | 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
  | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
  | 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
  | 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 	at java.lang.Thread.run(Thread.java:595)
  | Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=andre-99ar76ely/156, BranchQual=, localId=156] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.validator.InvalidStateException: validation failed for: com.simac.domain.Equipesimac)
  | 	at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
  | 	at org.jboss.tm.TxManager.commit(TxManager.java:240)
  | 	at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:140)
  | 	at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.commitOrRollback(SeamExtendedManagedPersistencePhaseListener.java:87)
  | 	... 26 more
  | Caused by: javax.persistence.PersistenceException: org.hibernate.validator.InvalidStateException: validation failed for: com.simac.domain.Equipesimac
  | 	at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:487)
  | 	at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
  | 	at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
  | 	at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
  | 	... 29 more
  | Caused by: org.hibernate.validator.InvalidStateException: validation failed for: com.simac.domain.Equipesimac
  | 	at org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:104)
  | 	at org.hibernate.validator.event.ValidateEventListener.onPreUpdate(ValidateEventListener.java:132)
  | 	at org.hibernate.action.EntityUpdateAction.preUpdate(EntityUpdateAction.java:217)
  | 	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:64)
  | 	at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
  | 	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
  | 	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
  | 	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
  | 	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
  | 	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:993)
  | 	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
  | 	at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:475)
  | 	... 32 more
  | 



  | 
  | 	@IfInvalid(outcome = Outcome.REDISPLAY)
  | 	public String update() {
  | 		refreshFinder();
  | 		return null;
  | 	}
  | 

and this bean:

	
  |         @Valid
  | 	private Equipesimac instance = new Equipesimac();
  | 
  | 	@TransactionAttribute(NOT_SUPPORTED)
  | 	public Equipesimac getInstance() {
  | 		return instance;
  | 

Weird thing. Bean creation works fine!!!


  |         @Begin(join = true)
  | 	@IfInvalid(outcome = Outcome.REDISPLAY)
  | 	public String create() {
  | 		if (entityManager.find(Equipesimac.class, instance.getCodigoEquipe()) != null) {
  | 			FacesContext.getCurrentInstance().addMessage(
  | 					null,
  | 					new FacesMessage(messages.get("Equipesimac_codigoEquipe")
  | 							+ " " + messages.get("AlreadyExists")));
  | 			return null;
  | 		}
  | 		entityManager.persist(instance);
  | 		isNew = false;
  | 		refreshFinder();
  | 		return "editEquipesimac";
  | 	}
  | 
  | 
  | 

Thanks for some help.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971159#3971159

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971159



More information about the jboss-user mailing list