<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    problem faced with taskList = taskService.createTaskQuery().processInstanceId(piID).list();
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/pjazzar">paul jazzar</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/602332#602332">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello I am getting the below error when i try to use the taskQuery in JBPM4.4 </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This is the code i am using : </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">taskList = taskService.createTaskQuery().processInstanceId(piID).list();
&#160;
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Error Thrown:</p><pre class="jive-pre"><code class="jive-code">


20:06:37,799 INFO&#160; [STDOUT] &gt;&gt;&gt;&gt;fetching tasks for Process:&#160; ProcessX.110373


20:06:37,799 WARN&#160; [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@4ba811c6


20:06:37,799 WARN&#160; [JDBCExceptionReporter] SQL Error: 0, SQLState: null


20:06:37,799 ERROR [JDBCExceptionReporter] 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 &lt; ac, BasicAction: -3f579bfb:d820:4dae9a67:13d8ff status: ActionStatus.ABORT_ONLY &gt;); - 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 &lt; ac, BasicAction: -3f579bfb:d820:4dae9a67:13d8ff status: ActionStatus.ABORT_ONLY &gt;))


20:06:37,799 INFO&#160; [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.query.TaskQueryImpl@5404f06


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.hql.QueryLoader.list(QueryLoader.java:401)


 at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)


 at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)


 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)


 at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)


 at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:93)


 at org.jbpm.pvm.internal.query.TaskQueryImpl.execute(TaskQueryImpl.java:231)


 at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:83)


 at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)


 at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:83)


 at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:62)


 at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)


 at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)


 at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)


 at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)


 at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)


 at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)


 at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:64)


 at org.jbpm.pvm.internal.query.TaskQueryImpl.list(TaskQueryImpl.java:255)


 at com.vmac.dao.JBPMDao.SearchDysfonctionnement(JBPMDao.java:2053)


 at com.vmac.web.JBPMController.SearchDysfonctionnement(JBPMController.java:436)


 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:597)


 at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:473)


 at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)


 at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)


 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)


 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)


 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)


 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)


 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)


 at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)


 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)


 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)


 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)


 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)


 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.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:619)


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 &lt; ac, BasicAction: -3f579bfb:d820:4dae9a67:13d8ff status: ActionStatus.ABORT_ONLY &gt;); - 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 &lt; ac, BasicAction: -3f579bfb:d820:4dae9a67:13d8ff status: ActionStatus.ABORT_ONLY &gt;))


 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)


 ... 67 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 &lt; ac, BasicAction: -3f579bfb:d820:4dae9a67:13d8ff status: ActionStatus.ABORT_ONLY &gt;)


 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)


 ... 69 more


Caused by: javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple &lt; ac, BasicAction: -3f579bfb:d820:4dae9a67:13d8ff status: ActionStatus.ABORT_ONLY &gt;


 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)


 ... 73 more


20:06:37,799 INFO&#160; [STDOUT] &gt;&gt;&gt;&gt;Exception thrown trying to retreive tasks 




</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks for your help.</p><p>PJ.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/602332#602332">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>