9 Replies Latest reply on Sep 30, 2010 6:44 AM by Leo van den berg

    problem with combobox.

    Andrea Vanz Newbie

      Hello, I have a combobox in the templateDoc.xhtml that works properly. When I use that same code for the combobox in the documentoList.xhtml it doesn't work. When I start the application in the page where I should see the combobox, it appears the following error: Cannot open connection.


      I don't understand why.


      Can you help me?


      Stack trace



      org.hibernate.exception.GenericJDBCException: Cannot open connection
          at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
          at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
          at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
          at org.hibernate.loader.Loader.doQuery(Loader.java:696)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
          at org.hibernate.loader.Loader.doList(Loader.java:2228)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
          at org.hibernate.loader.Loader.list(Loader.java:2120)
          at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
          at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
          at org.jboss.seam.bpm.TaskInstancePriorityList.getTaskInstanceList(TaskInstancePriorityList.java:45)
          at org.jboss.seam.bpm.TaskInstancePriorityList.getTaskInstanceList(TaskInstancePriorityList.java:38)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:616)
          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
          at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
          at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
          at org.jboss.seam.util.Work.workInTransaction(Work.java:61)
          at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
          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:185)
          at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
          at org.jboss.seam.bpm.TaskInstancePriorityList_$$_javassist_seam_7.getTaskInstanceList(TaskInstancePriorityList_$$_javassist_seam_7.java)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:616)
          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
          at org.jboss.seam.Component.callComponentMethod(Component.java:2261)
          at org.jboss.seam.Component.unwrap(Component.java:2287)
          at org.jboss.seam.Component.getInstance(Component.java:2041)
          at org.jboss.seam.Component.getInstance(Component.java:1983)
          at org.jboss.seam.Component.getInstance(Component.java:1977)
          at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:155)
          at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
          at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
          at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
          at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
          at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
          at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
          at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
          at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:924)
          at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
          at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
          at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
          at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
          at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:200)
          at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:195)
          at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
          at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
          at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
          at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
          at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
          at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
          at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
          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.web.IdentityFilter.doFilter(IdentityFilter.java:40)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
          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:206)
          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
          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:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Thread.java:636)
      Caused by: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000101:8d0a:4c9f0d29:81 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000101:8d0a:4c9f0d29:81 status: ActionStatus.ABORT_ONLY >))
          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
          at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
          at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
          ... 117 more
      Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000101:8d0a:4c9f0d29:81 status: ActionStatus.ABORT_ONLY >)
          at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:409)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:625)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:499)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
          ... 119 more
      Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000101:8d0a:4c9f0d29:81 status: ActionStatus.ABORT_ONLY >
          at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.java:879)
          at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:675)
          at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:403)
          ... 123 more



      Combobox code:


      <h:selectOneMenu value="#{templateHome.instance.idAmbienti}" style=" width : 210px;">
        <s:selectItems value="#{ambientiList.resultList}" var="_ambienti" 
        label="#{_ambienti.name}" itemValue="#{_ambienti.getId().toString()}" />
      </h:selectOneMenu>



      templateDoc.xhtml, page where it works:


      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:rich="http://richfaces.org/rich"
          template="layout/template.xhtml">
      
      <ui:define name="body">
          <h:form id="creazioneTemplate">
              <rich:panel>
                  <f:facet name="header">Creazione template</f:facet>
                  <p>Scegli i parametri per la creazione del template</p>
                  <div class="dialog">
                      <h:panelGrid columns="2">
                          <h:outputLabel for="ambiente">Nome Template</h:outputLabel>
                  <h:inputText id="nomeTemplate" required="true" value="#{templateHome.instance.name}" style=" width : 205px;"/>
                  <h:outputLabel for="ambiente">Ambiente</h:outputLabel>
                            <h:selectOneMenu value="#{templateHome.instance.idAmbienti}" style=" width : 210px;">
                      <s:selectItems value="#{ambientiList.resultList}" var="_ambienti" 
                      label="#{_ambienti.name}" itemValue="#{_ambienti.getId().toString()}" />
                  </h:selectOneMenu>
              </h:panelGrid>
                  </div>
              </rich:panel>
          <div>
              <h:column>
                          <h:commandButton id="crea" value="Crea" action="#{templateHome.persist}" rendered="#{!templateHome.managed}"/>
              </h:column> 
              <h:column>
                  <s:button propagation="end" id="cancel" value="Cancel" view="/home.xhtml" />
              </h:column>
          </div>
          </h:form>
      </ui:define>
      </ui:composition>



      documentoList.xhtml, page where it doesn't work:


      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
      
          <ui:define name="body">
      
                          
              <h:form id="description" rendered="#{authenticator.isRedattore()}">
                  <rich:panel>
                      <f:facet name="header">Crezione processi</f:facet>
      
                       <h:panelGrid columns="2" cellpadding="2">
                      Nome del Documento:<h:inputText id="description" required="true"
                          value="#{todoDoc.description}" style="width: 400" />
                      
                      Scegli il template:
                                  <h:selectOneMenu value="#{templateHome.instance.idAmbienti}" style=" width : 210px;">
                          <s:selectItems value="#{ambientiList.resultList}" var="_ambienti" 
                          label="#{_ambienti.name}" itemValue="#{_ambienti.getId().toString()}" />
                      </h:selectOneMenu>
                      </h:panelGrid>
                  </rich:panel>
                  <div>
                  <h:commandButton value="Ciclo 3 step (RVA)" action="#{todoDoc.createTodo}" /> 
                  <h:commandButton value="Ciclo 2 step (RA)" action="#{todoDoc.createTodo2}" />
      
                  </div>
              </h:form>
              <br />
              <br />
      
              <rich:panel>
                  <f:facet name="header">Task propri</f:facet>
                  <div id="list"><h:form id="list">
                      <div><h:outputText value="Nessun task presente."
                          rendered="#{empty taskInstancePriorityList}" /> 
                      <h:dataTable value="#{taskInstancePriorityList}" var="task"
                          rendered="#{not empty taskInstancePriorityList}">
      
                          [...]
                          
                      </h:dataTable></div>
      
                      <div><h:commandButton value="Update Items"
                          rendered="#{not empty taskInstanceList}" /></div>
                  </h:form></div>
              </rich:panel>
              <br />
              <br />
              <rich:panel>
                  [......]
              </rich:panel>
          </ui:define>
      </ui:composition>








        • 1. Re: problem with combobox.
          Leo van den berg Master

          Hi,


          do a simple test and wrap the task panel (task propri) in ui:remove to see if the cocurrent access to jBPM and Seam creates the problem (because I don't think the selectMenu is the cauise of your problem)


          If that works, look at your configuration of jBPM.


          Leo

          • 2. Re: problem with combobox.
            Andrea Vanz Newbie

            When I take out the jbpm part the combo is displayed correctly. Is there a way to have it displayed in the same page where I have the jpbm code (I mean in the documento. List.xhtml)?

            • 3. Re: problem with combobox.
              Leo van den berg Master

              Hi,


              I suspect it has to do with the fact that jBPM has its own Transaction handling which is synchronized with Seam but not fully integrated. The errorlist shows a nested SQL exception, so something is not working as it should.


              Check you jBPM configuration. I use the following. Although I still have some minor TX-synchronization problems with jBPM, it works:



              <jbpm-configuration>
                <jbpm-context>
                  <service name="persistence">
                     <factory>
                        <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                           <field name="isTransactionEnabled"><false/></field>
                        </bean>
                     </factory>
                  </service>
                  <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
                  <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
              
                  <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
                  <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
                  <boolean name="jbpm.hide.stale.object.exceptions" value="true" />
                </jbpm-context>
              </jbpm-configuration>



              I use the same DB for my doamin model and jBPM!!


              Leo


              • 4. Re: problem with combobox.
                Andrea Vanz Newbie

                I copied your code into my configuration file of jbpm(file jbpm.cfg.xml) but the problem persists.


                To obviate the problem, I decided to show the combobox and start the processDefinition in another page (creaDoc.xhtml) that is different from the management page of Process. Doing this I have a new problem: I start the process and associate this to an Actor but, when I step to the next task (crealling the conferma method), an error occurs.



                Exception during request processing:
                Caused by javax.el.ELException with message: "java.lang.IllegalStateException: begin method invoked from a long-running conversation, try using @Begin(join=true) on method: conferma" 
                





                org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339)
                org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
                org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
                org.jboss.seam.navigation.Pages.callAction(Pages.java:692)
                org.jboss.seam.navigation.Pages.preRender(Pages.java:330)
                org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
                org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
                org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
                org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
                com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                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.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                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:206)
                org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                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:235)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                java.lang.Thread.run(Thread.java:636)
                
                Caused by java.lang.IllegalStateException with message: "begin method invoked from a long-running conversation, try using @Begin(join=true) on method: conferma"
                
                org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:47)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
                org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                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:185)
                org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
                org.domain.docmanager.session.TodoDoc_$$_javassist_seam_8.conferma(TodoDoc_$$_javassist_seam_8.java)
                sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                java.lang.reflect.Method.invoke(Method.java:616)
                org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
                org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
                org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
                org.jboss.seam.navigation.Pages.callAction(Pages.java:692)
                org.jboss.seam.navigation.Pages.preRender(Pages.java:330)
                org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:561)
                org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:472)
                org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
                org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
                com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
                com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
                com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                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.web.IdentityFilter.doFilter(IdentityFilter.java:40)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
                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:206)
                org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
                org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
                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:235)
                org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                java.lang.Thread.run(Thread.java:636)
                



                I wrote @Begin(join=true) like suggested but the problem persists.



                creaDoc.xhtml




                          <h:form id="description" rendered="#{authenticator.isRedattore()}">
                               <rich:panel>
                                    <f:facet name="header">Crezione processi</f:facet>
                                    <h:panelGrid columns="2" cellpadding="2">
                                         <ui:remove>
                                                         Scegli il template:
                                              <h:selectOneMenu>
                                                   <s:selectItems value="#{templateList.resultList}" var="_template"
                                                        label="#{_template.name}" itemValue="#{_template.name}" />
                                              </h:selectOneMenu>
                                         </ui:remove>
                                         <ui:remove></ui:remove>               
                                    Nome del Documento:<h:inputText id="description" required="true"
                                              value="#{todoDoc.description}" style="width: 400" />
                
                                    </h:panelGrid>
                               </rich:panel>
                               <div><h:commandButton value="Ciclo 3 step (RVA)"
                                    action="#{todoDoc.createTodo}" /> <h:commandButton
                                    value="Ciclo 2 step (RA)" action="#{todoDoc.createTodo2}" /> <s:link
                                    view="/documentoList.xhtml">Visualizza lista documenti</s:link></div>
                          </h:form>
                
                



                todoDoc.java


                @Name("todoDoc")
                public class TodoDoc {
                     private String description;
                     private String nomeDoc=new String();
                     public String getDescription()
                     {
                          return description;
                     }
                     public void setDescription(String description) {
                          this.description = description;
                     }
                
                
                     @CreateProcess(definition="todo")
                     public void createTodo() {
                          nomeDoc=description;
                     }
                
                     @CreateProcess(definition="todo2") 
                     public void createTodo2(){          
                          nomeDoc=description;
                     }
                     
                     @Begin(join=true)
                     @StartTask @EndTask
                     public void conferma() {     
                          this.idprocesso();
                
                     }
                     
                     @StartTask @EndTask(transition="rifiuta")
                     public void rifiuta() {
                          idprocesso();
                     }
                     public void idprocesso(){
                          if("redazione".equals(TaskInstance.instance().getName())){
                                    ProcessInstance.instance().getContextInstance().createVariable(
                                              "Var",TaskInstance.instance().getDescription().toString());
                          }
                          nomeDoc=ProcessInstance.instance().getContextInstance().getVariable("Var").toString();
                     }
                     public String getNomeDoc() {
                          return nomeDoc;
                     }
                     public void setNomeDoc(String nomeDoc) {
                          this.nomeDoc = nomeDoc;
                     }
                }
                

                • 5. Re: problem with combobox.
                  Leo van den berg Master

                  Hi,


                  this is a famous feature of JBPM in combination with Seam. You can't start a process from an long-running conversation. So you neede to end the conversation first (for instance in pages.xml)


                  Leo

                  • 6. Re: problem with combobox.
                    Andrea Vanz Newbie

                    Hi Leo,
                    Can you explain me better? I can't understand why I may start the process and manage it in a single page but I can't start the process in a page(creaDoc.xhtml) and manage it in another page(documentoList.xhtml).

                    • 7. Re: problem with combobox.
                      Leo van den berg Master

                      Hi,


                      jBPM in Seam seams to use a slighthly different conveesation. If you try to satrt a new process while there is a long running conversation, it gives you the error you mentioned. When jBPM kicks in, it creates a fresh long-running conversation which is maintained over various pages, server shut-down etc., because it relies on jBPM to store state. However, after creating the task, there is no problem, you can use whatever steps, while the process-state is maintained. It's just the first stpe where jBPM needs the normal conversation.


                      Hopefully the real jBPM experts on this forum (there a a few but not very active lately) are able to answer this conceptual glitch in-depth.


                      Leo   

                      • 8. Re: problem with combobox.
                        Andrea Vanz Newbie

                        So, I can't start the process in a page and manage it in another through the problem of long-rinning conversations.
                        I can't have a combobox and the magagement of the process for the same reason?

                        • 9. Re: problem with combobox.
                          Leo van den berg Master

                          Hi,


                          You can basically do anything you want, but creating the process WITH AN ANNOTATION from a long-running process gives problem. So the thing I have found that everything works fine if you (annotationbased) create the process WITHOUT a long-runnign conversation. or handle the creation process yourself. But this is what i've found and doing at the moment. So I have everything working perfectly, but in some cases I use the annotations and in other I don't. At the moment the process is started, everything works great.


                          Leo