10 Replies Latest reply on Apr 13, 2006 11:13 AM by a a

    Connection buildup with JTA/Jbpm

    a a Newbie

      I am trying to use JBpm with JTA.
      Here's what I have done so far (as highlighted by the documentation):
      As part of the deployment procedure, jbpm-3.1.jar become jbpm.har with the following jboss-service.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
       <attribute name="DatasourceName">java:/JbpmDS</attribute>
       <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
       <attribute name="Dialect">org.hibernate.dialect.Oracle9Dialect</attribute>
       <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
       <attribute name="ShowSqlEnabled">true</attribute>
       </mbean>
      </server>


      Here's the datasource's descriptor:

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>JbpmDS</jndi-name>
       <connection-property name="SetBigStringTryClob">true</connection-property>
       <connection-url>jdbc:oracle:thin:@***:1521:***</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>***</user-name>
       <password>***</password>
       <min-pool-size>0</min-pool-size>
       <max-pool-size>100</max-pool-size>
       <blocking-timeout-millis>5000</blocking-timeout-millis>
       <idle-timeout-minutes>1</idle-timeout-minutes>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <track-statements>true</track-statements>
       <prepared-statement-cache-size>1000</prepared-statement-cache-size>
       </local-tx-datasource>
      </datasources>
      


      Now, my jbpm configuration:

      <jbpm-configuration>
      
       <jbpm-context>
       <service name="persistence">
       <factory>
       <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
       <field name="isTransactionEnabled"><false /></field>
       <field name="sessionFactoryJndiName">
       <string value="java:/hibernate/SessionFactory" />
       </field>
       <field name="dataSourceJndiName">
       <string value="java:/JbpmDS" />
       </field>
       </bean>
       </factory>
       </service>
       <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
       <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
       <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
       </jbpm-context>
      
       <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
       <!-- string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" /-->
       <!-- <string name="resource.hibernate.properties" value="hibernate.properties" /> -->
       <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
       <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
       <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
       <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
       <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
       <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
       <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
      
       <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
       <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
       <long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
      
      </jbpm-configuration>
      


      I also use a JbpmSchedulerServlet that handles scheduling:

       public void init() throws ServletException {
       // create a new scheduler
       scheduler = new Scheduler();
      
       // initialize it with the servlet init parameters
       int interval = Integer.parseInt(getInitParameter("interval", "5000"));
       scheduler.setInterval(interval);
       int historyMaxSize = Integer.parseInt(getInitParameter("historyMaxSize", "50"));
       scheduler.setHistoryMaxSize(historyMaxSize);
      
       // put the scheduler in the web app context
       getServletContext().setAttribute("scheduler", scheduler);
      
       // start the scheduler
       scheduler.start();
       }
      
       public void destroy() {
       scheduler.stop();
       }
      


      My problem is that when I check the jmx-console, the ManagedConnectionPool associated with the datasource shows the InUseConnectionCount ramping up quickly while the ConnectionDestroyedCount stays to 0.
      Rather quicly, the max number of connections will have been reached.

      Is there a version of the Scheduler than can use transactions? (a MBean maybe?) What am I doing wrong otherwise?

      On a different note, I have tried the following (in a Session bean called from a MBean):
       StopWatch watch = new StopWatch();
       watch.start();
      
       if (log.isDebugEnabled())
       log.debug("perform: entering");
      
       JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
       JbpmContext jbpmContext = null;
       try {
       jbpmContext = jbpmConfiguration.createJbpmContext();
       GraphSession graphSession = jbpmContext.getGraphSession();
      
       ProcessDefinition processDefinition =
       graphSession.findLatestProcessDefinition("opennmsSynchronization");
      
       ProcessInstance processInstance = new ProcessInstance(processDefinition);
       ContextInstance contextInstance = processInstance.getContextInstance();
       contextInstance.setVariable("syncContext", syncContext);
      
       Token token = processInstance.getRootToken();
       token.signal(); // get started...
      
       //log.debug(token.getNode().getName());
      
       jbpmContext.save(processInstance);
       } finally {
       if(jbpmContext != null) jbpmContext.close();
       }
      
       watch.stop();
       if (log.isDebugEnabled()) {
       log.debug("perform: SynchronizeCpe initialized "
       + watch);
       }
      


      It seems to work but subsequently fails with the following message annoucing me that the connection should have been closed but wasn't.
      13:24:15,972 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@13c3ba2
      java.lang.Throwable: STACKTRACE
       at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:333)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:482)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
       at org.jbpm.persistence.db.DbPersistenceService.getConnection(DbPersistenceService.java:113)
       at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:81)
       at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:216)
       at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:427)
       at com.newedgenetworks.phoenix.ejb.session.jmxsupport.OpenNMSSyncSupportBean.startSynchronizationWorkflow(OpenNMSSyncSupportBean.java:248)
       at com.newedgenetworks.phoenix.ejb.session.jmxsupport.OpenNMSSyncSupportBean.forceSynchronizeCpe(OpenNMSSyncSupportBean.java:234)
       at com.newedgenetworks.phoenix.ejb.session.jmxsupport.OpenNMSSyncSupportBean.forceSynchronizeCpe(OpenNMSSyncSupportBean.java:180)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
       at org.jboss.ejb.Container.invoke(Container.java:873)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
       at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
       at $Proxy659.forceSynchronizeCpe(Unknown Source)
       at com.newedgenetworks.phoenix.jmx.OpenNMSCpeSync.synchronizeCpeWithOpenNMS(OpenNMSCpeSync.java:83)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:243)
       at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:208)
       at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:247)
       at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:85)
       at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:67)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      1
      


      Can anyone help with these two issues (could be the same...)

      - Anthony


        • 2. Re: Connection buildup with JTA/Jbpm
          Olivier Kloss Newbie

          I'm also trying to have a working configuration using jbpm with JTA and encountering various problems.
          My setup differs largely from yours but looking at your code, I see that you are getting the session by creating the context and not by opening a connection/session.
          Have you had a look at those two threads:

          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=67431
          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=74906

          • 3. Re: Connection buildup with JTA/Jbpm
            a a Newbie

            Using connection/session is a deprecated practice, which is why I am not using it.
            I followed the first post's recommendation but it didn't help (while the properties concerning the transaction flsuh etc is loaded, the behavior is the same).

            I did also try to close the session manually with no success.

            jbpmContext.getSession().flush();
            jbpmContext.getSession().close();


            Don't know what to try next...

            You mentioned your configuration "differs largely", do you mind telling me how you got JTA to work?

            Thanks

            • 4. Re: Connection buildup with JTA/Jbpm
              Olivier Kloss Newbie

              Sorry about that bit on session/connection, we're still using 3.0.x and haven't gotten around to upgrading to 3.1

              All I did was follow the second thread I posted. It's been a while though and I don't remember if I had to do more.

              Mind you this doesn't work for me either. I mean, it barely works. I can get results from the database and that's it.
              Creating a process instance for example, I get an exception that basically says it can't resolve a one-to-many relationship from the "many" side.

              Because I had just so much time to learn Hibernate in addition to learning jbpm aswell as datasource management with JBoss, this has been put on the back-burner; I have other work to do. Will get back to this in a couple of weeks.

              Whish I could help you!




              • 5. Re: Connection buildup with JTA/Jbpm
                Brian Viveiros Newbie

                Thanks for posting your setup, it helped me get up and running pretty quickly.

                I was getting the same stack trace as you but was able to fix it by removing the dataSourceJndiName from the jbpm.cfg.xml. So my config looks like the following:

                <service name="persistence">
                 <factory>
                 <bean
                 class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                 <field name="isTransactionEnabled"><false /></field>
                 <field name="sessionFactoryJndiName">
                 <string value="java:/hibernate/JbpmSessionFactory" />
                 </field>
                 </bean>
                 </factory>
                </service>


                However, I am still seeing the following warning. Any ideas?

                [resource.connectionmanager.TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.


                • 6. Re: Connection buildup with JTA/Jbpm
                  a a Newbie

                  Yeah! It worked!
                  It's all fine now. I wish someone had documented this properly as I lost a couple days on this :-(
                  Anyhow, all is well now :-)
                  Thanks for your input.

                  • 7. Re: Connection buildup with JTA/Jbpm
                    sean liu Newbie

                     

                    <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                     <field name="isTransactionEnabled"><false /></field>
                     <!--
                     <field name="sessionFactoryJndiName">
                     <string value="java:/hibernate/SessionFactory" />
                     </field>
                     -->
                    
                     <field name="dataSourceJndiName">
                     <string value="java:/db/OracleDS" />
                     </field>
                    </bean>
                    

                    I think it should use only sessionFactoryJndiName or dataSourceJndiName configuration,not both. That's because sessionFactory configuration alrealy includes datasource information, like this:
                    <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate-sf-ora">
                     <attribute name="DatasourceName">java:/db/OracleDS</attribute>
                     <attribute name="Dialect">org.hibernate.dialect.Oracle9Dialect</attribute>
                     <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
                     <attribute name="SessionFactoryInterceptor">com.wxxr.persistence.bean.AuditInterceptor</attribute>
                     </mbean>
                    .

                    But when i use sessionFactory instead of dataSource like above configuration, it seems that system can not load jbpm hibernate mapping files. how do your guys do that?

                    • 8. Re: Connection buildup with JTA/Jbpm
                      sean liu Newbie

                      Another issue is that when i use Datasource configuration(not sessionFactory), sometimes system throws exceptions about "No ManagedConnections available within configured". Configuration is as following:

                       <factory>
                       <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
                       <field name="isTransactionEnabled"><false /></field>
                       <!--
                       <field name="sessionFactoryJndiName">
                       <string value="java:/hibernate/SessionFactory" />
                       </field>
                       -->
                      
                       <field name="dataSourceJndiName">
                       <string value="java:/db/OracleDS" />
                       </field>
                      
                       </bean>
                       </factory>

                      the stack trace of exception is as following:

                      com.wxxr.worklist.model.BizProcessException: Caught Throwable when try to retrieve worklist for user :operator
                      at com.wxxr.workflow.jbpm.JbpmEngine.getWorkListOfUsers(JbpmEngine.java:687)
                      at com.wxxr.workflow.jbpm.JbpmEngineService.getWorkListOfUsers(JbpmEngineService.java:181)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:585)
                      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                      at com.wxxr.workflow.jbpm.ContextInterceptor.invoke(ContextInterceptor.java:56)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                      at org.jboss.system.server.jmx.LazyMBeanServer.invoke(LazyMBeanServer.java:225)
                      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
                      at $Proxy192.getWorkListOfUsers(Unknown Source)
                      at com.wxxr.worklist.ejb.WorklistControllerImpl.getWorkListOfUsers(WorklistControllerImpl.java:107)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:585)
                      at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
                      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
                      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
                      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
                      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
                      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
                      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
                      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
                      at com.wxxr.common.jboss.EjbInvokerInterceptor.invoke(EjbInvokerInterceptor.java:79)
                      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
                      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
                      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
                      at org.jboss.ejb.Container.invoke(Container.java:873)
                      at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:585)
                      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
                      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
                      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
                      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
                      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
                      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
                      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
                      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
                      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
                      at $Proxy156.getWorkListOfUsers(Unknown Source)
                      at com.wxxr.web.worklist.util.AssignmentTool.getUserAssignment(AssignmentTool.java:158)
                      at com.wxxr.web.worklist.presentation.SearchMenuRenderer.doPropertyConf(SearchMenuRenderer.java:59)
                      at com.wxxr.web.worklist.presentation.AbstractMenuRenderer.renderMenu(AbstractMenuRenderer.java:60)
                      at com.hygensoft.framework.frontend.security.DefaultMenuRenderer.doRendering(DefaultMenuRenderer.java:52)
                      at com.hygensoft.framework.frontend.presentation.FieldTag.doAfterBody(FieldTag.java:60)
                      at org.apache.jsp.jsp.U2_jsp._jspx_meth_hg_menu_4(org.apache.jsp.jsp.U2_jsp:911)
                      at org.apache.jsp.jsp.U2_jsp._jspx_meth_hg_msgBox_3(org.apache.jsp.jsp.U2_jsp:868)
                      at org.apache.jsp.jsp.U2_jsp._jspx_meth_hg_form_0(org.apache.jsp.jsp.U2_jsp:487)
                      at org.apache.jsp.jsp.U2_jsp._jspService(org.apache.jsp.jsp.U2_jsp:152)
                      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
                      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
                      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
                      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
                      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
                      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
                      at com.hygensoft.framework.frontend.navigation.Navigator.forward(Navigator.java:235)
                      at com.hygensoft.framework.frontend.navigation.Navigator.navigateTo(Navigator.java:162)
                      at com.hygensoft.framework.frontend.action.RequestDispatcher.doNavigation(RequestDispatcher.java:302)
                      at com.hygensoft.framework.frontend.action.RequestDispatcher.dispatch(RequestDispatcher.java:223)
                      at com.wxxr.common.web.servlet.DispatchServlet.service(DispatchServlet.java:47)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at com.wxxr.web.worklist.servlet.FrequenceSubmitFilter.doFilter(FrequenceSubmitFilter.java:73)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at com.wxxr.common.web.filter.SecurityFilter.doFilter(SecurityFilter.java:82)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                      at java.lang.Thread.run(Thread.java:595)
                      Caused by: org.jbpm.JbpmException: couldn't obtain connection from datasource
                      at org.jbpm.persistence.db.DbPersistenceService.getConnection(DbPersistenceService.java:116)
                      at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:81)
                      at org.jbpm.persistence.db.DbPersistenceService.getTaskMgmtSession(DbPersistenceService.java:261)
                      at org.jbpm.JbpmContext.getTaskMgmtSession(JbpmContext.java:435)
                      at org.jbpm.JbpmContext.getGroupTaskList(JbpmContext.java:196)
                      at com.wxxr.workflow.jbpm.JbpmEngine.getWorklistOfUser(JbpmEngine.java:586)
                      at com.wxxr.workflow.jbpm.JbpmEngine.getWorkListOfUsers(JbpmEngine.java:678)
                      ... 107 more
                      Caused by: org.jboss.util.NestedSQLException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] ))
                      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:79)
                      at org.jbpm.persistence.db.DbPersistenceService.getConnection(DbPersistenceService.java:113)
                      ... 113 more
                      Caused by: javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 30000 [ms] )
                      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:246)
                      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:566)
                      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:410)
                      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:342)
                      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:462)
                      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
                      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
                      ... 114 more

                      Then i use neither of dataSource and SessionFactory, that is to say, i set configuration in hibernate.cfg.xml like this:
                       <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
                       <property name="hibernate.connection.url">jdbcurl</property>
                       <property name="hibernate.connection.username">user</property>
                       <property name="hibernate.connection.password">password</property>

                      It will be ok.

                      • 9. Re: Connection buildup with JTA/Jbpm
                        Olivier Kloss Newbie

                         

                        "bviveiros" wrote:
                        However, I am still seeing the following warning. Any ideas?

                        [resource.connectionmanager.TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction with more than one branch may result in inconsistent data in some cases of failure.


                        To resolve this, you need to setup your datasources as XA datasources.
                        There should be something about this in the JBoss wiki.
                        see:
                        http://wiki.jboss.org/wiki/Wiki.jsp?page=PrepareCalledOnALocalTx
                        It's not much help, I know, but I had the same message and configuring the datasources as XA fixed it.


                        • 10. Re: Connection buildup with JTA/Jbpm
                          a a Newbie

                           

                          "foreverman" wrote:

                          I think it should use only sessionFactoryJndiName or dataSourceJndiName configuration,not both. That's because sessionFactory configuration alrealy includes datasource information, like this:

                          But when i use sessionFactory instead of dataSource like above configuration, it seems that system can not load jbpm hibernate mapping files. how do your guys do that?


                          Right, makes sense but the documentation says otherwise :-)

                          To deploy the hibernate stuff, I modified the jbpm-3.2.jar with the following:
                          - renamed to jbpm.har
                          - added a jboss-service.xml file in the META-INF directory with the following content:
                          <?xml version="1.0" encoding="UTF-8"?>
                          
                          <server>
                          
                           <mbean code="org.jbpm.db.jmx.JbpmService"
                           name="jboss.jbpm:name=DefaultJbpm,service=JbpmService"
                           description="Default jBPM Service">
                           <attribute name="JndiName">java:/jbpm/Configuration</attribute>
                           <depends>jboss.jca:service=DataSourceBinding,name=JbpmDS</depends>
                           <depends>jboss.har:service=Hibernate</depends>
                           </mbean>
                          
                           <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
                           <attribute name="DatasourceName">java:/JbpmDS</attribute>
                           <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
                           <attribute name="Dialect">org.hibernate.dialect.Oracle9Dialect</attribute>
                           <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
                           <!-- attribute name="ShowSqlEnabled">true</attribute -->
                           <depends>jboss.jca:service=DataSourceBinding,name=JbpmDS</depends>
                           </mbean>
                          </server>
                          


                          which start 2 services: the Jbpm configuration service and the Hibernate service. The hibernate service will deploy the Har file with the given parameters. Note that by doing this, the hibernate.properties and hibernate.cfg.xml become obsolete.

                          Hope this helps.
                          - Anthony