cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while suspending a process

c_arunrathnakum
Champ in-the-making
Champ in-the-making
Hi,
I created my process engine as

ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
configuration.setDataSourceJndiName("java:jboss/datasources/workflow");
configuration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE);
configuration.setJobExecutorActivate(true);
configuration.setTransactionsExternallyManaged(true);
ProcessEngine engine = configuration.buildProcessEngine();

    I created a webservice called testSuspend(String processInstanceId) which in turn calls the suspendProcess() of activiti.
  
    When i call the service testSuspend(String processInstanceId) as a soap service, it works, the process gets suspended.

    But when i call the testSuspend(String processInstanceId) from another webservice, it throws an exception as follows.


Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error opening session.  Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@e075b8a[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@f11fad9 connection handles=0 lastUse=1362658278602 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1a61c596 pool internal context=SemaphoreArrayListManagedConnectionPool@45299c4c[pool=workflowV2] xaResource=LocalXAResourceImpl@10b9a6e3[connectionListener=e075b8a connectionManager=17462cb2 warned=false currentXid=null] txSync=null]
### Cause: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@e075b8a[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@f11fad9 connection handles=0 lastUse=1362658278602 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1a61c596 pool internal context=SemaphoreArrayListManagedConnectionPool@45299c4c[pool=workflowV2] xaResource=LocalXAResourceImpl@10b9a6e3[connectionListener=e075b8a connectionManager=17462cb2 warned=false currentXid=null] txSync=null]
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:83)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:32)
        at org.activiti.engine.impl.db.DbSqlSession.<init>(DbSqlSession.java:94)
        at org.activiti.engine.impl.db.DbSqlSessionFactory.openSession(DbSqlSessionFactory.java:130)
        at org.activiti.engine.impl.interceptor.CommandContext.getSession(CommandContext.java:197)
        at org.activiti.engine.impl.persistence.AbstractManager.getSession(AbstractManager.java:61)
        at org.activiti.engine.impl.persistence.AbstractManager.getDbSqlSession(AbstractManager.java:57)
        at org.activiti.engine.impl.persistence.entity.TaskManager.findTasksByQueryCriteria(TaskManager.java:109)
        at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:459)
        at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:138)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:60)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
        at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:112)
        at net.treetechnologies.workflow.services.Tasks.getTasks(Tasks.java:889)
        … 75 more
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@e075b8a[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@f11fad9 connection handles=0 lastUse=1362658278602 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1a61c596 pool internal context=SemaphoreArrayListManagedConnectionPool@45299c4c[pool=workflowV2] xaResource=LocalXAResourceImpl@10b9a6e3[connectionListener=e075b8a connectionManager=17462cb2 warned=false currentXid=null] txSync=null]
        at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:137)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:73)
        … 89 more
Caused by: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@e075b8a[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@f11fad9 connection handles=0 lastUse=1362658278602 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@1a61c596 pool internal context=SemaphoreArrayListManagedConnectionPool@45299c4c[pool=workflowV2] xaResource=LocalXAResourceImpl@10b9a6e3[connectionListener=e075b8a connectionManager=17462cb2 warned=false currentXid=null] txSync=null]
        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:604)
        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:467)
        at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)
        … 90 more
Caused by: javax.resource.ResourceException: IJ000461: Could not enlist in transaction on entering meta-aware object
        at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:474)
        at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:599)
        … 92 more
Caused by: javax.transaction.SystemException: IJ000356: Failed to enlist: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 0:ffff7f000001:-be300e2:513834f1:1f4b status: ActionStatus.ABORT_ONLY >
        at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.checkEnlisted(TxConnectionListener.java:552)
        at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:282)
        at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:467)
        … 93 more



    I use JBOSS as7.
7 REPLIES 7

frederikherema1
Star Contributor
Star Contributor
Suspending an already suspended will throw an exception, as the javadoc states. Is this the case?


/**
   * Suspends the process instance with the given id.
   *
   * If a process instance is in state suspended, activiti will not
   * execute jobs (timers, messages) associated with this instance.
   *
   * If you have a process instance hierarchy, suspending
   * one process instance form the hierarchy will not suspend other
   * process instances form that hierarchy.
   *
   *  @throws ActivitiObjectNotFoundException if no such processInstance can be found.
   *  @throws ActivitiException the process instance is already in state suspended.
   */
  void suspendProcessInstanceById(String processInstanceId);

c_arunrathnakum
Champ in-the-making
Champ in-the-making
No… while i try to suspend the one which is active

frederikherema1
Star Contributor
Star Contributor
Looks like an issue with the database-connection:


Unchecked throwable in managedConnectionReconnected()

Is there a difference in how the 2 web services obtain a reference to activiti/the database?

c_arunrathnakum
Champ in-the-making
Champ in-the-making
Not at all: The method is like

//service1
testInvoke()
{
    suspendProcess(processInstanceId);
}

//service2
suspendProcess(String processInstanceId)
{
    processEngine.getRuntimeService().suspendProcessInstanceById(processInstanceId);
}



When i try to invoke service2 alone from soap, its working fine.
But when i try to invoke service1, it throws me an exception.

frederikherema1
Star Contributor
Star Contributor
Do other API-calls work from inside the service that contains the failing suspend-call?

c_arunrathnakum
Champ in-the-making
Champ in-the-making
Yes they fail

frederikherema1
Star Contributor
Star Contributor
Does the service1 or 2 have transaction-annotations on them? Or are they in the evil hands of any aspect-weaving?