5 Replies Latest reply on Aug 25, 2009 5:40 AM by Arbi Sookazian

    Custom validator, issue with entityManager

    H G Newbie

      Hi,


      I'm implementing custom validator like seam component and  it work fine. The issue appear where I add aj4:support to the input field and when I quickly change and back the focus on the mentioned field, multiple ajax request are fired and offten I get:


      /Connection handle has been closed and is unusable/


      and after that often is raised:


      /Closing a connection for you.  Please close them yourself/


      If I put the decorate code snipet in a region and append it to status I get a debug page.


      All the exceptions and the debug page are shown in detail below.


      I'm using Jboss tools with Seam 3.0.1.GA-R200905070146-H18 and richfaces 3.3.1
      The project is using only POJOs.




      This is the custom validator code:


      package package.path;
      
      import java.io.Serializable;
      import java.util.List;
      
      import javax.faces.application.FacesMessage;
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      import javax.faces.validator.ValidatorException;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import javax.persistence.Query;
      
      
      import path.entity.User;
      
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.Transactional;
      import org.jboss.seam.annotations.faces.Validator;
      import org.jboss.seam.log.Log;
      import org.jboss.seam.faces.FacesMessages;
      
      @Name("userNameValidator")
      @Validator
      @Scope(ScopeType.CONVERSATION)
      public class UserNameValidator implements javax.faces.validator.Validator, Serializable {
      
        @In EntityManager entityManager;
      
        @Transactional
        public void validate(FacesContext context, UIComponent component, Object value)
            throws ValidatorException {
                
              
      
          entityManager.joinTransaction();
      
          String login = (String) value;
      
          Query query = entityManager.createQuery("select u from path.entity.User u where u.login = :login");
          query.setParameter("login", login);
          query.getResultList();
          if (query.getResultList().size() > 0) {
            throw new ValidatorException(makeMessage("The faces message"));
          }
        }
      
        private FacesMessage makeMessage(String s) {
          FacesMessage message = new FacesMessage();
          message.setDetail(s);
          message.setSummary(s);
          message.setSeverity(FacesMessage.SEVERITY_ERROR);
          return message;
        }
      }
      




      This is the view code:




      <s:decorate id="usernameDecorator" template="layout/edit.xhtml">
                              <ui:define name="label">Username:</ui:define>
      
              
                              <h:inputText id="rusername" value="#{register.userNameReg}" required="true">
                                  
                                  <f:validator validatorId="userNameValidator"/>
                                  <a4j:support event="onblur" reRender="usernameDecorator" ignoreDupResponses="true"
                                               bypassUpdates="true" ajaxSingle="true" />
                                  
                              </h:inputText>
                              
                           
                               <rich:message for="rusername">
                                              <f:facet name="passedMarker">
                                                      <h:graphicImage  style="margin: 0 0 4px 4px" value="/img/passed.gif" /> 
                                              </f:facet>
                                              <f:facet name="errorMarker">
                                                      <h:graphicImage style="margin: 0 0 4px 4px" value="/img/error.gif" />   
                                              </f:facet>
                                      </rich:message> 
                          </s:decorate>



        • 1. Re: Custom validator, issue with entityManager
          H G Newbie

          This is the exception raised in fist place in the console:



          15:11:52,234 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
          15:11:52,234 ERROR [JDBCExceptionReporter] Connection handle has been closed and is unusable
          15:11:52,234 WARN  [lifecycle] javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
          javax.faces.FacesException: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                  at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                  at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                  at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                  at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                  at java.lang.Thread.run(Thread.java:595)
          Caused by: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                  at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                  at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                  ... 54 more
          Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
                  at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
                  at mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:48)
                  at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                  at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                  at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
                  at org.jboss.seam.util.Work.workInTransaction(Work.java:41)
                  at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                  at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                  at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                  at mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
                  at org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
                  at javax.faces.component.UIInput.validate(UIInput.java:875)
                  at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
                  at javax.faces.component.UIInput.processValidators(UIInput.java:672)
                  at org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
                  at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                  ... 65 more
          Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
                  at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                  at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                  at org.hibernate.loader.Loader.doList(Loader.java:2223)
                  at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                  at org.hibernate.loader.Loader.list(Loader.java:2099)
                  at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                  at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                  at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                  at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                  at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                  at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
                  ... 95 more
          Caused by: java.sql.SQLException: Connection handle has been closed and is unusable
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:832)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:813)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:238)
                  at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:528)
                  at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:446)
                  at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                  at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                  at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                  at org.hibernate.loader.Loader.doList(Loader.java:2220)
                  ... 103 more
          15:11:52,312 ERROR [lifecycle] JSF1054: (Phase ID: PROCESS_VALIDATIONS 3, View ID: /login.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@d26103]
          15:11:53,500 ERROR [ExceptionFilter] handling uncaught exception
          javax.servlet.ServletException: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                  at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                  at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                  at java.lang.Thread.run(Thread.java:595)
          Caused by: javax.faces.FacesException: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                  at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                  at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                  ... 39 more
          Caused by: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                  at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                  at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                  ... 54 more
          Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
                  at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
                  at mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:48)
                  at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                  at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                  at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
                  at org.jboss.seam.util.Work.workInTransaction(Work.java:41)
                  at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                  at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                  at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                  at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                  at mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
                  at org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
                  at javax.faces.component.UIInput.validate(UIInput.java:875)
                  at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
                  at javax.faces.component.UIInput.processValidators(UIInput.java:672)
                  at org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
                  at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                  ... 65 more
          Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
                  at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
                  at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
                  at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
                  at org.hibernate.loader.Loader.doList(Loader.java:2223)
                  at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                  at org.hibernate.loader.Loader.list(Loader.java:2099)
                  at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                  at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                  at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                  at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                  at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                  at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
                  ... 95 more
          Caused by: java.sql.SQLException: Connection handle has been closed and is unusable
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:832)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:813)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:238)
                  at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:528)
                  at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:446)
                  at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                  at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                  at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                  at org.hibernate.loader.Loader.doList(Loader.java:2220)
                  ... 103 more
          15:11:53,640 ERROR [ExceptionFilter] exception root cause
          javax.faces.FacesException: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                  at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                  at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                  at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                  at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                  at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                  at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                  at java.lang.Thread.run(Thread.java:595)
          Caused by: javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                  at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                  at org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                  at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                  at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                  at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                  ... 54 more
          
          Caused by: java.sql.SQLException: Connection handle has been closed and is unusable
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:832)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:813)
                  at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:238)
                  at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:528)
                  at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:446)
                  at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                  at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                  at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                  at org.hibernate.loader.Loader.doList(Loader.java:2220)
                  ... 103 more
          15:11:54,250 INFO  [CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@e8cc94


          • 2. Re: Custom validator, issue with entityManager
            H G Newbie

            And after that in the console often is fired:



            15:12:07,281 INFO  [CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@f4ffd8
            java.lang.Throwable: STACKTRACE
                    at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
                    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:424)
                    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)
                    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:90)
                    at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
                    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                    at org.hibernate.loader.Loader.doQuery(Loader.java:673)
                    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                    at org.hibernate.loader.Loader.doList(Loader.java:2220)
                    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                    at org.hibernate.loader.Loader.list(Loader.java:2099)
                    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
                    at mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:47)
                    at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                    at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                    at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
                    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
                    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
                    at org.jboss.seam.util.Work.workInTransaction(Work.java:41)
                    at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
                    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                    at mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
                    at org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
                    at javax.faces.component.UIInput.validate(UIInput.java:875)
                    at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
                    at javax.faces.component.UIInput.processValidators(UIInput.java:672)
                    at org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
                    at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                    at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                    at org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                    at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                    at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                    at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                    at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                    at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                    at java.lang.Thread.run(Thread.java:595)

            • 3. Re: Custom validator, issue with entityManager
              H G Newbie

              Debug page when is used status with region:



               

              Business Process Context
              Empty business process context
              + -  Session Context
              javax.faces.request.charset
              org.ajax4jsf.application.AjaxStateHolder
              org.ajax4jsf.application.AjaxStateManager.view_sequence
              org.jboss.seam.core.conversationEntries
              org.jboss.seam.international.localeSelector
              org.jboss.seam.security.identity
              org.jboss.seam.web.session
              + -  Application Context
              LanguageListener.component
              _init_parameter_org.richfaces.CONTROL_SKINNING
              _init_parameter_org.richfaces.CONTROL_SKINNING_CLASSES
              _init_parameter_org.richfaces.CONTROL_SKINNING_LEVEL
              _init_parameter_org.richfaces.LoadScriptStrategy
              _init_parameter_org.richfaces.LoadStyleStrategy
              _init_parameter_org.richfaces.queue.global.enabled
              authenticator.component
              com.sun.faces.ApplicationAssociate
              com.sun.faces.ApplicationImpl
              com.sun.faces.config.WebConfiguration
              com.sun.faces.sunJsfJs
              drumEntityManagerFactory
              drumEntityManagerFactory.component
              emailValidator.component
              entityManager.component
              javax.servlet.context.tempdir
              org.ajax4jsf.webapp.PollEventsManager
              org.ajax4jsf.webapp.WebXml
              org.apache.AnnotationProcessor
              org.apache.catalina.WELCOME_FILES
              org.apache.catalina.jsp_classpath
              org.apache.catalina.resources
              org.apache.jasper.runtime.JspApplicationContextImpl
              org.jboss.seam.async.dispatcher.component
              org.jboss.seam.captcha.captcha.component
              org.jboss.seam.captcha.captchaImage.component
              org.jboss.seam.core.ConversationIdGenerator
              org.jboss.seam.core.ConversationIdGenerator.component
              org.jboss.seam.core.contexts.component
              org.jboss.seam.core.conversation.component
              org.jboss.seam.core.conversationEntries.component
              org.jboss.seam.core.conversationListFactory.component
              org.jboss.seam.core.conversationPropagation.component
              org.jboss.seam.core.conversationStackFactory.component
              org.jboss.seam.core.events.component
              org.jboss.seam.core.expressions
              org.jboss.seam.core.expressions.component
              org.jboss.seam.core.init
              org.jboss.seam.core.init.component
              org.jboss.seam.core.interpolator.component
              org.jboss.seam.core.locale.component
              org.jboss.seam.core.manager.component
              org.jboss.seam.core.resourceBundle.component
              org.jboss.seam.core.resourceLoader.component
              org.jboss.seam.core.validators.component
              org.jboss.seam.debug.contexts
              org.jboss.seam.debug.contexts.component
              org.jboss.seam.debug.hotDeployFilter
              org.jboss.seam.debug.hotDeployFilter.component
              org.jboss.seam.debug.introspector.component
              org.jboss.seam.exception.exceptions.component
              org.jboss.seam.faces.dataModels.component
              org.jboss.seam.faces.facesContext.component
              org.jboss.seam.faces.facesMessages.component
              org.jboss.seam.faces.facesPage.component
              org.jboss.seam.faces.httpError.component
              org.jboss.seam.faces.redirect.component
              org.jboss.seam.faces.renderer.component
              org.jboss.seam.faces.switcher.component
              org.jboss.seam.faces.uiComponent.component
              org.jboss.seam.faces.validation.component
              org.jboss.seam.framework.currentDate.component
              org.jboss.seam.framework.currentDatetime.component
              org.jboss.seam.framework.currentTime.component
              org.jboss.seam.graphicImage.image.component
              org.jboss.seam.international.localeSelector.component
              org.jboss.seam.international.messagesFactory.component
              org.jboss.seam.international.timeZone.component
              org.jboss.seam.international.timeZoneSelector.component
              org.jboss.seam.mail.mailSession.component
              org.jboss.seam.navigation.pages
              org.jboss.seam.navigation.pages.component
              org.jboss.seam.navigation.safeActions.component
              org.jboss.seam.pdf.documentStore.component
              org.jboss.seam.persistence.persistenceContexts.component
              org.jboss.seam.persistence.persistenceProvider.component
              org.jboss.seam.properties
              org.jboss.seam.remoting.gwt.gwtToSeamAdapter.component
              org.jboss.seam.remoting.remoting.component
              org.jboss.seam.security.configurationFactory.component
              org.jboss.seam.security.entityPermissionChecker.component
              org.jboss.seam.security.facesSecurityEvents
              org.jboss.seam.security.facesSecurityEvents.component
              org.jboss.seam.security.identity.component
              org.jboss.seam.theme.themeFactory.component
              org.jboss.seam.theme.themeSelector.component
              org.jboss.seam.transaction.synchronizations.component
              org.jboss.seam.transaction.transaction.component
              org.jboss.seam.ui.EntityConverter.component
              org.jboss.seam.ui.entityIdentifierStore.component
              org.jboss.seam.ui.entityLoader.component
              org.jboss.seam.ui.facelet.faceletCompiler.component
              org.jboss.seam.ui.graphicImage.graphicImageResource.component
              org.jboss.seam.ui.graphicImage.graphicImageStore.component
              org.jboss.seam.ui.hibernateEntityLoader.component
              org.jboss.seam.ui.resource.safeStyleResources.component
              org.jboss.seam.ui.resource.styleResource.component
              org.jboss.seam.ui.resource.webResource.component
              org.jboss.seam.web.ajax4jsfFilter
              org.jboss.seam.web.ajax4jsfFilter.component
              org.jboss.seam.web.ajax4jsfFilterInstantiator.component
              org.jboss.seam.web.exceptionFilter
              org.jboss.seam.web.exceptionFilter.component
              org.jboss.seam.web.isUserInRole.component
              org.jboss.seam.web.loggingFilter
              org.jboss.seam.web.loggingFilter.component
              org.jboss.seam.web.multipartFilter
              org.jboss.seam.web.multipartFilter.component
              org.jboss.seam.web.parameters.component
              org.jboss.seam.web.redirectFilter
              org.jboss.seam.web.redirectFilter.component
              org.jboss.seam.web.servletContexts.component
              org.jboss.seam.web.session.component
              org.jboss.seam.web.userPrincipal.component
              org.richfaces.util.RenderPhaseComponentVisitorUtils
              register.component
              rute.component
              securityRules
              securityRules.component
              userNameValidator.component
              + -  Exception
              Exception during request processing:
              Caused by javax.servlet.ServletException with message: "javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection"
              
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
              org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
              org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              java.lang.Thread.run(Thread.java:595)
              
              Caused by javax.faces.FacesException with message: "javax.faces.FacesException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection"
              
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
              org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
              com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
              com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
              org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
              org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              java.lang.Thread.run(Thread.java:595)
              
              Caused by javax.faces.FacesException with message: "javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection"
              
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:725)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
              org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
              org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
              org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
              com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
              com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
              org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
              org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              java.lang.Thread.run(Thread.java:595)
              
              Caused by javax.persistence.PersistenceException with message: "org.hibernate.exception.GenericJDBCException: Cannot open connection"
              
              org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
              org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
              mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:48)
              sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              java.lang.reflect.Method.invoke(Method.java:585)
              org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
              org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
              org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
              org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
              org.jboss.seam.util.Work.workInTransaction(Work.java:41)
              org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
              org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
              org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
              org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
              mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
              org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
              javax.faces.component.UIInput.validate(UIInput.java:875)
              javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
              javax.faces.component.UIInput.processValidators(UIInput.java:672)
              org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
              org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
              org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
              org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
              javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
              org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
              org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
              com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
              com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
              org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
              org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
              org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
              org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              java.lang.Thread.run(Thread.java:595)



              • 4. Re: Custom validator, issue with entityManager
                H G Newbie


                Caused by org.jboss.util.NestedSQLException with message: "Could not enlist in transaction on entering meta-aware object!; - nested throwable: (java.lang.IllegalStateException: Trying to change transaction TransactionImple < ac, BasicAction: -3f57fffe:48c:4a92f1c2:442 status: ActionStatus.RUNNING > in enlist!); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (java.lang.IllegalStateException: Trying to change transaction TransactionImple < ac, BasicAction: -3f57fffe:48c:4a92f1c2:442 status: ActionStatus.RUNNING > in enlist!))"
                
                org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:96)
                org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
                org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                org.hibernate.loader.Loader.doQuery(Loader.java:673)
                org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                org.hibernate.loader.Loader.doList(Loader.java:2220)
                org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                org.hibernate.loader.Loader.list(Loader.java:2099)
                org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
                mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:48)
                sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                java.lang.reflect.Method.invoke(Method.java:585)
                org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
                org.jboss.seam.util.Work.workInTransaction(Work.java:41)
                org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
                org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
                javax.faces.component.UIInput.validate(UIInput.java:875)
                javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
                javax.faces.component.UIInput.processValidators(UIInput.java:672)
                org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
                org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                java.lang.Thread.run(Thread.java:595)
                
                Caused by org.jboss.resource.JBossResourceException with message: "Could not enlist in transaction on entering meta-aware object!; - nested throwable: (java.lang.IllegalStateException: Trying to change transaction TransactionImple < ac, BasicAction: -3f57fffe:48c:4a92f1c2:442 status: ActionStatus.RUNNING > in enlist!)"
                
                org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:358)
                org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:525)
                org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:406)
                org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)
                org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:90)
                org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
                org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                org.hibernate.loader.Loader.doQuery(Loader.java:673)
                org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                org.hibernate.loader.Loader.doList(Loader.java:2220)
                org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                org.hibernate.loader.Loader.list(Loader.java:2099)
                org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
                mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:48)
                sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                java.lang.reflect.Method.invoke(Method.java:585)
                org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
                org.jboss.seam.util.Work.workInTransaction(Work.java:41)
                org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
                org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
                javax.faces.component.UIInput.validate(UIInput.java:875)
                javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
                javax.faces.component.UIInput.processValidators(UIInput.java:672)
                org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
                org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                java.lang.Thread.run(Thread.java:595)
                
                Caused by java.lang.IllegalStateException with message: "Trying to change transaction TransactionImple < ac, BasicAction: -3f57fffe:48c:4a92f1c2:442 status: ActionStatus.RUNNING > in enlist!"
                
                org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:545)
                org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:352)
                org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:525)
                org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:406)
                org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:850)
                org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:90)
                org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
                org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
                org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
                org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
                org.hibernate.loader.Loader.doQuery(Loader.java:673)
                org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
                org.hibernate.loader.Loader.doList(Loader.java:2220)
                org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
                org.hibernate.loader.Loader.list(Loader.java:2099)
                org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
                org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
                org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
                org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
                org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
                org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
                mobi.diib.drum.session.UserNameValidator.validate(UserNameValidator.java:48)
                sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                java.lang.reflect.Method.invoke(Method.java:585)
                org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:36)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:43)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
                org.jboss.seam.util.Work.workInTransaction(Work.java:41)
                org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                mobi.diib.drum.session.UserNameValidator_$$_javassist_1.validate(UserNameValidator_$$_javassist_1.java)
                org.richfaces.component.html.HtmlInputText.validateValue(HtmlInputText.java:52)
                javax.faces.component.UIInput.validate(UIInput.java:875)
                javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
                javax.faces.component.UIInput.processValidators(UIInput.java:672)
                org.ajax4jsf.component.UIAjaxRegion$2.invokeContextCallback(UIAjaxRegion.java:63)
                org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                org.ajax4jsf.component.UIAjaxRegion.processValidators(UIAjaxRegion.java:117)
                org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
                org.ajax4jsf.component.ContextCallbackWrapper.invokeContextCallback(ContextCallbackWrapper.java:44)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:722)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:731)
                javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:675)
                org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:224)
                org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
                com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
                com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
                org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
                org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
                org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
                org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                java.lang.Thread.run(Thread.java:595)




                • 5. Re: Custom validator, issue with entityManager
                  Arbi Sookazian Master

                  From the stack trace it looks like you're trying (or at least the tx mgr is trying!) to enlist multiple resources in a distributed tx.


                  Why are you doing the following?


                  @Transactional
                    public void validate(FacesContext context, UIComponent component, Object value)
                        throws ValidatorException {
                            
                          
                  
                      entityManager.joinTransaction();
                  



                  @Transactional defaults to REQUIRED.  Try commenting the above line of code and then try again.