2 Replies Latest reply on Apr 3, 2008 5:15 AM by Shane Bryzak

    No JBPM Context during Seam Remoting calls, what gives?

    Brom bie Newbie

      Hi all,


      I'm having a hell of a time trying to get jBPM and Seam works nicely together regardless what have been touted in documentations.  Here's the latest issue I found.  Not sure if this is by design or a bug.


      I have a method on a stateless bean annotated with @CreateProcess(...) and @WebRemote  It works fine when I invoke through an h:commandButton, but when I call it through Seam Remoting, it didn't throw any exceptions, but it didn't create a jbpm process instance either.


      I tried taking off the @CreateProcess and instead, create the process instance manually through ManagedJbpmContext.instance().getGraphSession().findLatestProcessDefinition(), then I'll see this exception:



      01:31:12,187 ERROR [XAManagedConnectionFactory] Start transaction failed for org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@16a7dc1
      01:31:12,187 WARN  [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@fee392[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@16a7dc1 handles=0 lastUse=1207125069937 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@96b720 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@d09e62 xaResource=org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper@17d045 txSync=null]
      oracle.jdbc.xa.OracleXAException
           at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:938)
           at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:244)
           at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:121)
           at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.start(JcaXAResourceWrapper.java:113)
           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:865)
           at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:499)
           at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.enlist(TxConnectionManager.java:773)
           at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:564)
           at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:337)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
           at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
           at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
           at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
           at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
           at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
           at org.hibernate.loader.Loader.doQuery(Loader.java:673)
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
           at org.hibernate.loader.Loader.doList(Loader.java:2220)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
           at org.hibernate.loader.Loader.list(Loader.java:2099)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
           at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
           at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
      



      The Seam manual doesn't mention any differences between transaction management on Seam Remoting calls so I'm a bit a  loss with this issue.


      It's strange how wonderful Seam is until I start hitting into these issues with jBPM integration.  Thanks for your help!