You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Kristian Köhler <Kr...@dmc.de> on 2007/11/02 10:01:30 UTC

Threading problems with Ode

Hi

I encountered problems calling ode processes from multiple threads. I'm using ODE deployed as JBI component to servicemix running within Geronimo. 

My sample is a simple BPEL process which calls a remote service, also deployed as JBI component to Servicemix, and returning a value. I set up a JMeter test which is sending SOAP requests "to" my process. Running one thread is no problem. Calling the process from 4 or more threads results in "Internal Error"s returned from ODE (not every call of course ;-) ). 

---- 8< (start) ----
09:39:45,406 FATAL [BpelServerImpl] Internal Error
org.apache.ode.bpel.iapi.BpelEngineException: org.apache.ode.bpel.iapi.BpelEngineException: MUST RUN IN TRANSACTION!
        at org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(BpelProcess.java:423)
        at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:259)
        at org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke(MyRoleMessageExchangeImpl.java:132)
        at org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(UnreliableMyRoleMessageExchangeImpl.java:48
        at org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(UnreliableMyRoleMessageExchangeImpl.java:47
        at org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(BpelProcess.java:1122)
        at org.apache.ode.bpel.engine.Contexts.execTransaction(Contexts.java:118)
        at org.apache.ode.bpel.engine.BpelServerImpl$TransactedCallable.call(BpelServerImpl.java:833)
        at org.apache.ode.bpel.engine.BpelServerImpl$ServerCallable.call(BpelServerImpl.java:811)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.ode.bpel.iapi.BpelEngineException: MUST RUN IN TRANSACTION!
        at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:758)
        at org.apache.ode.bpel.engine.BpelProcess.executeCreateInstance(BpelProcess.java:314)
        at org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java:261)
        at org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java:260)
        at org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(BpelProcess.java:1122)
        at org.apache.ode.bpel.engine.BpelInstanceWorker.doInstanceWork(BpelInstanceWorker.java:174)
        at org.apache.ode.bpel.engine.BpelInstanceWorker.execInCurrentThread(BpelInstanceWorker.java:108)
        at org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(BpelProcess.java:420)
        ... 13 more

---- 8< (stop) ----

One thing i tried was to mark the 'org.apache.ode.bpel.engine.Contexts#execTransaction' method with the synchronized keyword.
This worked fine but was a bit slow ;-) 

--- 8< (start) ---
public synchronized <T> T execTransaction(Callable<T> transaction) throws Exception
--- 8< (stop) ---

I debugged a bit more and I it seems to me that the calling thread "looses" the transaction after the org.apache.ode.dao.jpa.ProcessDAOImpl#createInstance call. 

--- 8< (start) ---
org.apache.ode.dao.jpa.ProcessDAOImpl.createInstance(CorrelatorDAO)
org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRoleCreateInstance(MessageExchangeDAO, Operation, String, CorrelatorDAO)
org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(MessageExchangeDAO)
org.apache.ode.bpel.engine.BpelProcess.invokeProcess(MessageExchangeDAO)
org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke()
org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl.invokeAsync().new Callable<Void>() {...}.call()
--- 8< (stop) ---

I'm working on Windows XP, Java JDK 1.5.0_12 (Sun).

Is there any know solution to the problem? ;-)
Any help is welcome...

Kristian

---
http://gaswerk.sourceforge.net



Re: Threading problems with Ode

Posted by Matthieu Riou <ma...@offthelip.org>.
On Nov 5, 2007 11:08 PM, Kristian Köhler <Kr...@dmc.de> wrote:

> Hi
>
> > Matthieu's comments are valid if you deploy Ode as a webapp
> > (Axis2 IL).
>
> I'm using Ode within ServiceMix (JBI deployment). Not as a webapp.
>

Sorry about that, I should have read the whole thread.


>
> > However, when Ode is deployed inside a JBI container, it obtains its
> > TransactionManager instance through the ComponentContext, not by
> > lookup as is the case for webapp deployment.
> >
> > So if I understood correctly your deployment configuration, you should
> > double-check your ServixeMix configuration.
>
> This should be ok. ;-) The Geronimo Transaction Manager is set on the
> JBIContainer (ServiceMixGBean which is deployed within Geronimo). Is there
> any possibility to trace that i bit more?
>

You can set OpenJPA logging to debug to see whether it hooks properly on the
transaction manager in these failing transactions. But as I indicated
before, the transaction manager used by OpenJPA is set to bet the same one
used by ODE. Also the last stack you posted was when forcing the transaction
manager used byOpenJPA, do you have the same exception when using the normal
configuration?

Thanks,
Matthieu


> If I turn off persistence everything works great.
>
> Kristian
>
> >
> > alex
> >
> > On 11/5/07, Matthieu Riou <ma...@offthelip.org> wrote:
> > > Hi,
> > >
> > > You shouldn't try to set the OpenJPA transaction manager
> > independently, we
> > > set it to the same one configured on ODE. The problem you
> > probably have is
> > > that ODE, when set to use Geronimo, uses the Geronimo 1.1
> > GBean transaction
> > > manager instead of the global JNDI lookup that they've
> > implemented in 1.1.
> > > So that's the origin of your ClasscastException.
> > >
> > > What I would do is revert your changes for OpenJPA and
> > configure ODE to use
> > > the JBoss transaction factory. I know, that last part is
> > probably confusing
> > > but that's a little trick. Actually the JBossFactory uses a
> > standard JNDI
> > > lookup for java:/TransactionManager which didn't work with
> > Geronimo 1.1 but
> > > should work just fine with Geronimo 2.0 now that they have
> > a global JNDI. We
> > > should just rename JBossFactory to StandardFactory in the
> > next release so
> > > that it's less confusing. So something like this should do
> > the trick:
> > >
> > > ode-jbi.db.mode=EXTERNAL
> > > ode-jbi.db.ext.dataSource=java:db/OdeDatasource
> > > ode-jbi.tx.factory.class=org.apache.ode.axis2.util.JBossFactory
> > >
> > > Let us know how it goes and thanks for the good work on GASwerk!
> > >
> > > Matthieu
> > >
> > >
> > > On Nov 5, 2007 12:53 AM, Kristian Köhler
> > <Kr...@dmc.de> wrote:
> > >
> > > > Hi
> > > >
> > > >
> > > > > Is there a way to configure the Transaction Manager lookup
> > > > > from Ode. I like to use the TM used from the DataSource...
> > > >
> > > > I added the following properties to the persistence.xml
> > file within
> > > > bpel-store and dao-jpa.
> > > >
> > > > -- 8< (start) --
> > > >
> > > > <properties>
> > > >  <property name="openjpa.ManagedRuntime"
> > > > value="jndi(TransactionManagerName=java:/TransactionManager)"/>
> > > > </properties>
> > > >
> > > > -- 8< (end) --
> > > >
> > > > This works fine with 1 thread. When I test my sample with
> > 3 thrads the
> > > > following error arise (Invalid Xid):
> > > >
> > > > -- 8< (start) --
> > > >
> > > > 09:47:11,851 ERROR [SimpleScheduler] Error while
> > executing transaction
> > > > javax.transaction.RollbackException: Unable to commit:
> > transaction marked
> > > > for rollback
> > > >        at
> > org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > > > TransactionImpl.java:271)
> > > >        at
> > > >
> > org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> > > > TransactionManagerImpl.java:238)
> > > >        at
> > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > > > SimpleScheduler.java:180)
> > > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > SimpleScheduler.java:333)
> > > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > SimpleScheduler.java:330)
> > > >        at
> > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > > :269)
> > > >        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > > >        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > > ThreadPoolExecutor.java:650)
> > > >        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > > ThreadPoolExecutor.java:675)
> > > >        at java.lang.Thread.run(Thread.java:595)
> > > > 09:47:11,976 ERROR [SimpleScheduler] Error while
> > executing transaction
> > > > javax.transaction.RollbackException: Error during one-phase commit
> > > >        at
> > org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > > > TransactionImpl.java:311)
> > > >        at
> > > >
> > org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> > > > TransactionManagerImpl.java:238)
> > > >        at
> > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > > > SimpleScheduler.java:180)
> > > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > SimpleScheduler.java:333)
> > > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > SimpleScheduler.java:330)
> > > >        at
> > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > > :269)
> > > >        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > > >        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > > ThreadPoolExecutor.java:650)
> > > >        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > > ThreadPoolExecutor.java:675)
> > > >        at java.lang.Thread.run(Thread.java:595)
> > > > Caused by: javax.transaction.xa.XAException: Invalid Xid
> > > >        at
> > org.apache.geronimo.connector.outbound.LocalXAResource.commit(
> > > > LocalXAResource.java:53)
> > > >        at
> > org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > > > TransactionImpl.java:302)
> > > >        ... 9 more
> > > >
> > > > -- 8< (end) --
> > > >
> > > > Any ideas?
> > > >
> > > > Kristian
> > > >
> > > > > Hope this helps... ;-)
> > > > >
> > > > > Kristian
> > > > >
> > > > > ---
> > > > > http://gaswerk.sourceforge.net
> > > > >
> > > > > >
> > > > > > alex
> > > > > >
> > > > > >
> > > > > > On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> > > > > > >
> > > > > > >
> > > > > > > You're right this was with ode_trunk. My first test was
> > > > > > with version 1.1which resulted in the following error. I will
> > > > > > now test with the sendSynch
> > > > > > > property.
> > > > > > >
> > > > > > > Thanks!
> > > > > > >
> > > > > > > Kristian
> > > > > > >
> > > > > > > --- 8< ---
> > > > > > >
> > > > > > > 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> > > > > > > org.apache.ode.bpel.runtime.INVOKE" threw an
> > unexpected exception.
> > > > > > > org.apache.ode.bpel.iapi.ContextException: Unable
> > to register
> > > > > > > synchronizer.
> > > > > > >         at
> > > > > > >
> > > > > >
> > > > >
> > org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > > > > SimpleScheduler.java:200)
> > > > > > >         at
> > > > > > org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> > > > > > > :119)
> > > > > > >         at
> > > > > > org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> > > > > > > MessageExchangeContextImpl.java:60)
> > > > > > >         at
> > > > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> > > > > > > BpelRuntimeContextImpl.java:794)
> > > > > > >         at
> > org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
> > > > > > >         at
> > > > > > sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> > > > > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > > > > > DelegatingMethodAccessorImpl.java:25)
> > > > > > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > > > > > >         at
> > org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> > > > > > > JacobVPU.java:451)
> > > > > > >         at
> > > > > > org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
> > > > > > >         at
> > > > > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > > > > > > BpelRuntimeContextImpl.java:836)
> > > > > > >         at
> > > > > > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> > > > > > > PartnerLinkMyRoleImpl.java:193)
> > > > > > >         at
> > org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > > > > > > BpelProcess.java:169)
> > > > > > >         at
> > org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > > > > > > BpelProcess.java:306)
> > > > > > >         at
> > > > > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > > > > > > BpelEngineImpl.java:318)
> > > > > > >         at
> > > > > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > > > > > > BpelServerImpl.java:364)
> > > > > > >         at
> > > > > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > > > > SimpleScheduler.java:335)
> > > > > > >         at
> > > > > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > > > > SimpleScheduler.java:334)
> > > > > > >         at
> > > > > >
> > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> > > > > > > (SimpleScheduler.java:173)
> > > > > > >         at
> > org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > > > > SimpleScheduler.java:333)
> > > > > > >         at
> > org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > > > > SimpleScheduler.java:330)
> > > > > > >         at
> > > > > > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > > > > > :269)
> > > > > > >         at
> > > > > java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > > > > > >         at
> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > > > > > ThreadPoolExecutor.java:650)
> > > > > > >         at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > > > > > ThreadPoolExecutor.java:675)
> > > > > > >         at java.lang.Thread.run(Thread.java:595)
> > > > > > > Caused by: java.lang.NullPointerException
> > > > > > >         at
> > > > > > >
> > > > > >
> > > > >
> > org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > > > > SimpleScheduler.java:188)
> > > > > > >         ... 25 more
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

AW: Threading problems with Ode

Posted by Kristian Köhler <Kr...@dmc.de>.
Hi

> Matthieu's comments are valid if you deploy Ode as a webapp 
> (Axis2 IL).

I'm using Ode within ServiceMix (JBI deployment). Not as a webapp.

> However, when Ode is deployed inside a JBI container, it obtains its
> TransactionManager instance through the ComponentContext, not by
> lookup as is the case for webapp deployment.
> 
> So if I understood correctly your deployment configuration, you should
> double-check your ServixeMix configuration.

This should be ok. ;-) The Geronimo Transaction Manager is set on the JBIContainer (ServiceMixGBean which is deployed within Geronimo). Is there any possibility to trace that i bit more?

If I turn off persistence everything works great.

Kristian

> 
> alex
> 
> On 11/5/07, Matthieu Riou <ma...@offthelip.org> wrote:
> > Hi,
> >
> > You shouldn't try to set the OpenJPA transaction manager 
> independently, we
> > set it to the same one configured on ODE. The problem you 
> probably have is
> > that ODE, when set to use Geronimo, uses the Geronimo 1.1 
> GBean transaction
> > manager instead of the global JNDI lookup that they've 
> implemented in 1.1.
> > So that's the origin of your ClasscastException.
> >
> > What I would do is revert your changes for OpenJPA and 
> configure ODE to use
> > the JBoss transaction factory. I know, that last part is 
> probably confusing
> > but that's a little trick. Actually the JBossFactory uses a 
> standard JNDI
> > lookup for java:/TransactionManager which didn't work with 
> Geronimo 1.1 but
> > should work just fine with Geronimo 2.0 now that they have 
> a global JNDI. We
> > should just rename JBossFactory to StandardFactory in the 
> next release so
> > that it's less confusing. So something like this should do 
> the trick:
> >
> > ode-jbi.db.mode=EXTERNAL
> > ode-jbi.db.ext.dataSource=java:db/OdeDatasource
> > ode-jbi.tx.factory.class=org.apache.ode.axis2.util.JBossFactory
> >
> > Let us know how it goes and thanks for the good work on GASwerk!
> >
> > Matthieu
> >
> >
> > On Nov 5, 2007 12:53 AM, Kristian Köhler 
> <Kr...@dmc.de> wrote:
> >
> > > Hi
> > >
> > >
> > > > Is there a way to configure the Transaction Manager lookup
> > > > from Ode. I like to use the TM used from the DataSource...
> > >
> > > I added the following properties to the persistence.xml 
> file within
> > > bpel-store and dao-jpa.
> > >
> > > -- 8< (start) --
> > >
> > > <properties>
> > >  <property name="openjpa.ManagedRuntime"
> > > value="jndi(TransactionManagerName=java:/TransactionManager)"/>
> > > </properties>
> > >
> > > -- 8< (end) --
> > >
> > > This works fine with 1 thread. When I test my sample with 
> 3 thrads the
> > > following error arise (Invalid Xid):
> > >
> > > -- 8< (start) --
> > >
> > > 09:47:11,851 ERROR [SimpleScheduler] Error while 
> executing transaction
> > > javax.transaction.RollbackException: Unable to commit: 
> transaction marked
> > > for rollback
> > >        at 
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > > TransactionImpl.java:271)
> > >        at
> > > 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> > > TransactionManagerImpl.java:238)
> > >        at 
> org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > > SimpleScheduler.java:180)
> > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > SimpleScheduler.java:333)
> > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > SimpleScheduler.java:330)
> > >        at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > :269)
> > >        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > >        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > ThreadPoolExecutor.java:650)
> > >        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > ThreadPoolExecutor.java:675)
> > >        at java.lang.Thread.run(Thread.java:595)
> > > 09:47:11,976 ERROR [SimpleScheduler] Error while 
> executing transaction
> > > javax.transaction.RollbackException: Error during one-phase commit
> > >        at 
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > > TransactionImpl.java:311)
> > >        at
> > > 
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> > > TransactionManagerImpl.java:238)
> > >        at 
> org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > > SimpleScheduler.java:180)
> > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > SimpleScheduler.java:333)
> > >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > SimpleScheduler.java:330)
> > >        at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > :269)
> > >        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > >        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > ThreadPoolExecutor.java:650)
> > >        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > ThreadPoolExecutor.java:675)
> > >        at java.lang.Thread.run(Thread.java:595)
> > > Caused by: javax.transaction.xa.XAException: Invalid Xid
> > >        at 
> org.apache.geronimo.connector.outbound.LocalXAResource.commit(
> > > LocalXAResource.java:53)
> > >        at 
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > > TransactionImpl.java:302)
> > >        ... 9 more
> > >
> > > -- 8< (end) --
> > >
> > > Any ideas?
> > >
> > > Kristian
> > >
> > > > Hope this helps... ;-)
> > > >
> > > > Kristian
> > > >
> > > > ---
> > > > http://gaswerk.sourceforge.net
> > > >
> > > > >
> > > > > alex
> > > > >
> > > > >
> > > > > On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> > > > > >
> > > > > >
> > > > > > You're right this was with ode_trunk. My first test was
> > > > > with version 1.1which resulted in the following error. I will
> > > > > now test with the sendSynch
> > > > > > property.
> > > > > >
> > > > > > Thanks!
> > > > > >
> > > > > > Kristian
> > > > > >
> > > > > > --- 8< ---
> > > > > >
> > > > > > 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> > > > > > org.apache.ode.bpel.runtime.INVOKE" threw an 
> unexpected exception.
> > > > > > org.apache.ode.bpel.iapi.ContextException: Unable 
> to register
> > > > > > synchronizer.
> > > > > >         at
> > > > > >
> > > > >
> > > > 
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > > > SimpleScheduler.java:200)
> > > > > >         at
> > > > > org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> > > > > > :119)
> > > > > >         at
> > > > > org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> > > > > > MessageExchangeContextImpl.java:60)
> > > > > >         at
> > > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> > > > > > BpelRuntimeContextImpl.java:794)
> > > > > >         at 
> org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
> > > > > >         at
> > > > > sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> > > > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > > > > DelegatingMethodAccessorImpl.java:25)
> > > > > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > > > > >         at 
> org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> > > > > > JacobVPU.java:451)
> > > > > >         at
> > > > > org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
> > > > > >         at
> > > > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > > > > > BpelRuntimeContextImpl.java:836)
> > > > > >         at
> > > > > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> > > > > > PartnerLinkMyRoleImpl.java:193)
> > > > > >         at 
> org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > > > > > BpelProcess.java:169)
> > > > > >         at 
> org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > > > > > BpelProcess.java:306)
> > > > > >         at
> > > > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > > > > > BpelEngineImpl.java:318)
> > > > > >         at
> > > > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > > > > > BpelServerImpl.java:364)
> > > > > >         at
> > > > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > > > SimpleScheduler.java:335)
> > > > > >         at
> > > > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > > > SimpleScheduler.java:334)
> > > > > >         at
> > > > > 
> org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> > > > > > (SimpleScheduler.java:173)
> > > > > >         at 
> org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > > > SimpleScheduler.java:333)
> > > > > >         at 
> org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > > > SimpleScheduler.java:330)
> > > > > >         at
> > > > > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > > > > :269)
> > > > > >         at
> > > > java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > > > > >         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > > > > ThreadPoolExecutor.java:650)
> > > > > >         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > > > > ThreadPoolExecutor.java:675)
> > > > > >         at java.lang.Thread.run(Thread.java:595)
> > > > > > Caused by: java.lang.NullPointerException
> > > > > >         at
> > > > > >
> > > > >
> > > > 
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > > > SimpleScheduler.java:188)
> > > > > >         ... 25 more
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> 

Re: Threading problems with Ode

Posted by Alex Boisvert <bo...@intalio.com>.
Matthieu's comments are valid if you deploy Ode as a webapp (Axis2 IL).

However, when Ode is deployed inside a JBI container, it obtains its
TransactionManager instance through the ComponentContext, not by
lookup as is the case for webapp deployment.

So if I understood correctly your deployment configuration, you should
double-check your ServixeMix configuration.

alex

On 11/5/07, Matthieu Riou <ma...@offthelip.org> wrote:
> Hi,
>
> You shouldn't try to set the OpenJPA transaction manager independently, we
> set it to the same one configured on ODE. The problem you probably have is
> that ODE, when set to use Geronimo, uses the Geronimo 1.1 GBean transaction
> manager instead of the global JNDI lookup that they've implemented in 1.1.
> So that's the origin of your ClasscastException.
>
> What I would do is revert your changes for OpenJPA and configure ODE to use
> the JBoss transaction factory. I know, that last part is probably confusing
> but that's a little trick. Actually the JBossFactory uses a standard JNDI
> lookup for java:/TransactionManager which didn't work with Geronimo 1.1 but
> should work just fine with Geronimo 2.0 now that they have a global JNDI. We
> should just rename JBossFactory to StandardFactory in the next release so
> that it's less confusing. So something like this should do the trick:
>
> ode-jbi.db.mode=EXTERNAL
> ode-jbi.db.ext.dataSource=java:db/OdeDatasource
> ode-jbi.tx.factory.class=org.apache.ode.axis2.util.JBossFactory
>
> Let us know how it goes and thanks for the good work on GASwerk!
>
> Matthieu
>
>
> On Nov 5, 2007 12:53 AM, Kristian Köhler <Kr...@dmc.de> wrote:
>
> > Hi
> >
> >
> > > Is there a way to configure the Transaction Manager lookup
> > > from Ode. I like to use the TM used from the DataSource...
> >
> > I added the following properties to the persistence.xml file within
> > bpel-store and dao-jpa.
> >
> > -- 8< (start) --
> >
> > <properties>
> >  <property name="openjpa.ManagedRuntime"
> > value="jndi(TransactionManagerName=java:/TransactionManager)"/>
> > </properties>
> >
> > -- 8< (end) --
> >
> > This works fine with 1 thread. When I test my sample with 3 thrads the
> > following error arise (Invalid Xid):
> >
> > -- 8< (start) --
> >
> > 09:47:11,851 ERROR [SimpleScheduler] Error while executing transaction
> > javax.transaction.RollbackException: Unable to commit: transaction marked
> > for rollback
> >        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > TransactionImpl.java:271)
> >        at
> > org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> > TransactionManagerImpl.java:238)
> >        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > SimpleScheduler.java:180)
> >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:333)
> >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:330)
> >        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > :269)
> >        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > ThreadPoolExecutor.java:650)
> >        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > ThreadPoolExecutor.java:675)
> >        at java.lang.Thread.run(Thread.java:595)
> > 09:47:11,976 ERROR [SimpleScheduler] Error while executing transaction
> > javax.transaction.RollbackException: Error during one-phase commit
> >        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > TransactionImpl.java:311)
> >        at
> > org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> > TransactionManagerImpl.java:238)
> >        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > SimpleScheduler.java:180)
> >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:333)
> >        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:330)
> >        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > :269)
> >        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > ThreadPoolExecutor.java:650)
> >        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > ThreadPoolExecutor.java:675)
> >        at java.lang.Thread.run(Thread.java:595)
> > Caused by: javax.transaction.xa.XAException: Invalid Xid
> >        at org.apache.geronimo.connector.outbound.LocalXAResource.commit(
> > LocalXAResource.java:53)
> >        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> > TransactionImpl.java:302)
> >        ... 9 more
> >
> > -- 8< (end) --
> >
> > Any ideas?
> >
> > Kristian
> >
> > > Hope this helps... ;-)
> > >
> > > Kristian
> > >
> > > ---
> > > http://gaswerk.sourceforge.net
> > >
> > > >
> > > > alex
> > > >
> > > >
> > > > On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> > > > >
> > > > >
> > > > > You're right this was with ode_trunk. My first test was
> > > > with version 1.1which resulted in the following error. I will
> > > > now test with the sendSynch
> > > > > property.
> > > > >
> > > > > Thanks!
> > > > >
> > > > > Kristian
> > > > >
> > > > > --- 8< ---
> > > > >
> > > > > 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> > > > > org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
> > > > > org.apache.ode.bpel.iapi.ContextException: Unable to register
> > > > > synchronizer.
> > > > >         at
> > > > >
> > > >
> > > org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > > SimpleScheduler.java:200)
> > > > >         at
> > > > org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> > > > > :119)
> > > > >         at
> > > > org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> > > > > MessageExchangeContextImpl.java:60)
> > > > >         at
> > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> > > > > BpelRuntimeContextImpl.java:794)
> > > > >         at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
> > > > >         at
> > > > sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> > > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > > > DelegatingMethodAccessorImpl.java:25)
> > > > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > > > >         at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> > > > > JacobVPU.java:451)
> > > > >         at
> > > > org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
> > > > >         at
> > > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > > > > BpelRuntimeContextImpl.java:836)
> > > > >         at
> > > > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> > > > > PartnerLinkMyRoleImpl.java:193)
> > > > >         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > > > > BpelProcess.java:169)
> > > > >         at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > > > > BpelProcess.java:306)
> > > > >         at
> > > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > > > > BpelEngineImpl.java:318)
> > > > >         at
> > > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > > > > BpelServerImpl.java:364)
> > > > >         at
> > > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > > SimpleScheduler.java:335)
> > > > >         at
> > > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > > SimpleScheduler.java:334)
> > > > >         at
> > > > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> > > > > (SimpleScheduler.java:173)
> > > > >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > > SimpleScheduler.java:333)
> > > > >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > > SimpleScheduler.java:330)
> > > > >         at
> > > > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > > > :269)
> > > > >         at
> > > java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > > > >         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > > > ThreadPoolExecutor.java:650)
> > > > >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > > > ThreadPoolExecutor.java:675)
> > > > >         at java.lang.Thread.run(Thread.java:595)
> > > > > Caused by: java.lang.NullPointerException
> > > > >         at
> > > > >
> > > >
> > > org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > > SimpleScheduler.java:188)
> > > > >         ... 25 more
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Threading problems with Ode

Posted by Matthieu Riou <ma...@offthelip.org>.
Hi,

You shouldn't try to set the OpenJPA transaction manager independently, we
set it to the same one configured on ODE. The problem you probably have is
that ODE, when set to use Geronimo, uses the Geronimo 1.1 GBean transaction
manager instead of the global JNDI lookup that they've implemented in 1.1.
So that's the origin of your ClasscastException.

What I would do is revert your changes for OpenJPA and configure ODE to use
the JBoss transaction factory. I know, that last part is probably confusing
but that's a little trick. Actually the JBossFactory uses a standard JNDI
lookup for java:/TransactionManager which didn't work with Geronimo 1.1 but
should work just fine with Geronimo 2.0 now that they have a global JNDI. We
should just rename JBossFactory to StandardFactory in the next release so
that it's less confusing. So something like this should do the trick:

ode-jbi.db.mode=EXTERNAL
ode-jbi.db.ext.dataSource=java:db/OdeDatasource
ode-jbi.tx.factory.class=org.apache.ode.axis2.util.JBossFactory

Let us know how it goes and thanks for the good work on GASwerk!

Matthieu


On Nov 5, 2007 12:53 AM, Kristian Köhler <Kr...@dmc.de> wrote:

> Hi
>
>
> > Is there a way to configure the Transaction Manager lookup
> > from Ode. I like to use the TM used from the DataSource...
>
> I added the following properties to the persistence.xml file within
> bpel-store and dao-jpa.
>
> -- 8< (start) --
>
> <properties>
>  <property name="openjpa.ManagedRuntime"
> value="jndi(TransactionManagerName=java:/TransactionManager)"/>
> </properties>
>
> -- 8< (end) --
>
> This works fine with 1 thread. When I test my sample with 3 thrads the
> following error arise (Invalid Xid):
>
> -- 8< (start) --
>
> 09:47:11,851 ERROR [SimpleScheduler] Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked
> for rollback
>        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> TransactionImpl.java:271)
>        at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> TransactionManagerImpl.java:238)
>        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> SimpleScheduler.java:180)
>        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:333)
>        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:330)
>        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> :269)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
> 09:47:11,976 ERROR [SimpleScheduler] Error while executing transaction
> javax.transaction.RollbackException: Error during one-phase commit
>        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> TransactionImpl.java:311)
>        at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> TransactionManagerImpl.java:238)
>        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> SimpleScheduler.java:180)
>        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:333)
>        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:330)
>        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> :269)
>        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>        at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.transaction.xa.XAException: Invalid Xid
>        at org.apache.geronimo.connector.outbound.LocalXAResource.commit(
> LocalXAResource.java:53)
>        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> TransactionImpl.java:302)
>        ... 9 more
>
> -- 8< (end) --
>
> Any ideas?
>
> Kristian
>
> > Hope this helps... ;-)
> >
> > Kristian
> >
> > ---
> > http://gaswerk.sourceforge.net
> >
> > >
> > > alex
> > >
> > >
> > > On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> > > >
> > > >
> > > > You're right this was with ode_trunk. My first test was
> > > with version 1.1which resulted in the following error. I will
> > > now test with the sendSynch
> > > > property.
> > > >
> > > > Thanks!
> > > >
> > > > Kristian
> > > >
> > > > --- 8< ---
> > > >
> > > > 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> > > > org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
> > > > org.apache.ode.bpel.iapi.ContextException: Unable to register
> > > > synchronizer.
> > > >         at
> > > >
> > >
> > org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > SimpleScheduler.java:200)
> > > >         at
> > > org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> > > > :119)
> > > >         at
> > > org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> > > > MessageExchangeContextImpl.java:60)
> > > >         at
> > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> > > > BpelRuntimeContextImpl.java:794)
> > > >         at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
> > > >         at
> > > sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> > > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > > DelegatingMethodAccessorImpl.java:25)
> > > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > > >         at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> > > > JacobVPU.java:451)
> > > >         at
> > > org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
> > > >         at
> > > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > > > BpelRuntimeContextImpl.java:836)
> > > >         at
> > > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> > > > PartnerLinkMyRoleImpl.java:193)
> > > >         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > > > BpelProcess.java:169)
> > > >         at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > > > BpelProcess.java:306)
> > > >         at
> > org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > > > BpelEngineImpl.java:318)
> > > >         at
> > org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > > > BpelServerImpl.java:364)
> > > >         at
> > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > SimpleScheduler.java:335)
> > > >         at
> > org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > > SimpleScheduler.java:334)
> > > >         at
> > > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> > > > (SimpleScheduler.java:173)
> > > >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > SimpleScheduler.java:333)
> > > >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > > SimpleScheduler.java:330)
> > > >         at
> > > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > > :269)
> > > >         at
> > java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > > >         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > > ThreadPoolExecutor.java:650)
> > > >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > > ThreadPoolExecutor.java:675)
> > > >         at java.lang.Thread.run(Thread.java:595)
> > > > Caused by: java.lang.NullPointerException
> > > >         at
> > > >
> > >
> > org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > > SimpleScheduler.java:188)
> > > >         ... 25 more
> > > >
> > > >
> > >
> >
>

Re: Threading problems with Ode

Posted by Alex Boisvert <bo...@intalio.com>.
I'm not too sure.... is your ServiceMix also configured to use Geronimo's
TransactionManager?  (java:/TransactionManager)

alex


On 11/5/07, Kristian Köhler <Kr...@dmc.de> wrote:
>
> Hi
>
>
> > Is there a way to configure the Transaction Manager lookup
> > from Ode. I like to use the TM used from the DataSource...
>
> I added the following properties to the persistence.xml file within
> bpel-store and dao-jpa.
>
> -- 8< (start) --
>
> <properties>
>   <property name="openjpa.ManagedRuntime"
> value="jndi(TransactionManagerName=java:/TransactionManager)"/>
> </properties>
>
> -- 8< (end) --
>
> This works fine with 1 thread. When I test my sample with 3 thrads the
> following error arise (Invalid Xid):
>
> -- 8< (start) --
>
> 09:47:11,851 ERROR [SimpleScheduler] Error while executing transaction
> javax.transaction.RollbackException: Unable to commit: transaction marked
> for rollback
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> TransactionImpl.java:271)
>         at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> (SimpleScheduler.java:180)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:333)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:330)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> :269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> 09:47:11,976 ERROR [SimpleScheduler] Error while executing transaction
> javax.transaction.RollbackException: Error during one-phase commit
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> TransactionImpl.java:311)
>         at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(
> TransactionManagerImpl.java:238)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> (SimpleScheduler.java:180)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:333)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:330)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> :269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.transaction.xa.XAException: Invalid Xid
>         at org.apache.geronimo.connector.outbound.LocalXAResource.commit(
> LocalXAResource.java:53)
>         at org.apache.geronimo.transaction.manager.TransactionImpl.commit(
> TransactionImpl.java:302)
>         ... 9 more
>
> -- 8< (end) --
>
> Any ideas?
>
> Kristian
>

AW: Threading problems with Ode

Posted by Kristian Köhler <Kr...@dmc.de>.
Hi


> Is there a way to configure the Transaction Manager lookup 
> from Ode. I like to use the TM used from the DataSource...

I added the following properties to the persistence.xml file within bpel-store and dao-jpa. 

-- 8< (start) --

<properties>
  <property name="openjpa.ManagedRuntime" value="jndi(TransactionManagerName=java:/TransactionManager)"/>
</properties>

-- 8< (end) --

This works fine with 1 thread. When I test my sample with 3 thrads the following error arise (Invalid Xid):

-- 8< (start) --

09:47:11,851 ERROR [SimpleScheduler] Error while executing transaction
javax.transaction.RollbackException: Unable to commit: transaction marked for rollback
        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:271)
        at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:180)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:333)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:330)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
09:47:11,976 ERROR [SimpleScheduler] Error while executing transaction
javax.transaction.RollbackException: Error during one-phase commit
        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:311)
        at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238)
        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:180)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:333)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:330)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.xa.XAException: Invalid Xid
        at org.apache.geronimo.connector.outbound.LocalXAResource.commit(LocalXAResource.java:53)
        at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:302)
        ... 9 more

-- 8< (end) --

Any ideas?

Kristian

> Hope this helps... ;-)
> 
> Kristian
> 
> ---
> http://gaswerk.sourceforge.net
> 
> > 
> > alex
> > 
> > 
> > On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> > >
> > >
> > > You're right this was with ode_trunk. My first test was 
> > with version 1.1which resulted in the following error. I will 
> > now test with the sendSynch
> > > property.
> > >
> > > Thanks!
> > >
> > > Kristian
> > >
> > > --- 8< ---
> > >
> > > 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> > > org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
> > > org.apache.ode.bpel.iapi.ContextException: Unable to register
> > > synchronizer.
> > >         at
> > > 
> > 
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > SimpleScheduler.java:200)
> > >         at 
> > org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> > > :119)
> > >         at 
> > org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> > > MessageExchangeContextImpl.java:60)
> > >         at 
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> > > BpelRuntimeContextImpl.java:794)
> > >         at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
> > >         at 
> > sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> > >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > > DelegatingMethodAccessorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > >         at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> > > JacobVPU.java:451)
> > >         at 
> > org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
> > >         at 
> > org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > > BpelRuntimeContextImpl.java:836)
> > >         at 
> > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> > > PartnerLinkMyRoleImpl.java:193)
> > >         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > > BpelProcess.java:169)
> > >         at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > > BpelProcess.java:306)
> > >         at 
> org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > > BpelEngineImpl.java:318)
> > >         at 
> org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > > BpelServerImpl.java:364)
> > >         at 
> org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > SimpleScheduler.java:335)
> > >         at 
> org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > > SimpleScheduler.java:334)
> > >         at 
> > org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> > > (SimpleScheduler.java:173)
> > >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > SimpleScheduler.java:333)
> > >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > > SimpleScheduler.java:330)
> > >         at 
> > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > > :269)
> > >         at 
> java.util.concurrent.FutureTask.run(FutureTask.java:123)
> > >         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > > ThreadPoolExecutor.java:650)
> > >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > > ThreadPoolExecutor.java:675)
> > >         at java.lang.Thread.run(Thread.java:595)
> > > Caused by: java.lang.NullPointerException
> > >         at
> > > 
> > 
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > > SimpleScheduler.java:188)
> > >         ... 25 more
> > >
> > >
> > 
> 

AW: Threading problems with Ode

Posted by Kristian Köhler <Kr...@dmc.de>.
Hi

> Can you provide more information on this?   It looks like a 
> configuration
> issue wrt TransactionManager.

Configuration issue sounds good to me! ;-) 

I'm using ODE within ServiceMix (3.2) within Geronimo (2.0.1). The ode-jbi.properties pointing to an external DataSource.  This DataSource is configured as a ConnectionPool within Geronimo. (I'm using MySQL.)

--- 8< ---

ode-jbi.db.mode=EXTERNAL
ode-jbi.db.ext.dataSource=java:db/OdeDatasource

--- 8< ---

The Geronimo transaction libs (coming from Geronimo 2.0.1) are used in my configuration. Using the 'Ode transaction libs' (Geronimo 1.2) resulted in ClassCastExceptions because the configured ConnectionPool uses the libs coming from the AppServer.

Is there a way to configure the Transaction Manager lookup from Ode. I like to use the TM used from the DataSource...

Hope this helps... ;-)

Kristian

---
http://gaswerk.sourceforge.net

> 
> alex
> 
> 
> On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> >
> >
> > You're right this was with ode_trunk. My first test was 
> with version 1.1which resulted in the following error. I will 
> now test with the sendSynch
> > property.
> >
> > Thanks!
> >
> > Kristian
> >
> > --- 8< ---
> >
> > 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> > org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
> > org.apache.ode.bpel.iapi.ContextException: Unable to register
> > synchronizer.
> >         at
> > 
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > SimpleScheduler.java:200)
> >         at 
> org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> > :119)
> >         at 
> org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> > MessageExchangeContextImpl.java:60)
> >         at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> > BpelRuntimeContextImpl.java:794)
> >         at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
> >         at 
> sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:585)
> >         at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> > JacobVPU.java:451)
> >         at 
> org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
> >         at 
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > BpelRuntimeContextImpl.java:836)
> >         at 
> org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> > PartnerLinkMyRoleImpl.java:193)
> >         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > BpelProcess.java:169)
> >         at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > BpelProcess.java:306)
> >         at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > BpelEngineImpl.java:318)
> >         at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > BpelServerImpl.java:364)
> >         at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > SimpleScheduler.java:335)
> >         at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > SimpleScheduler.java:334)
> >         at 
> org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> > (SimpleScheduler.java:173)
> >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:333)
> >         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:330)
> >         at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > :269)
> >         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > ThreadPoolExecutor.java:650)
> >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > ThreadPoolExecutor.java:675)
> >         at java.lang.Thread.run(Thread.java:595)
> > Caused by: java.lang.NullPointerException
> >         at
> > 
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> > SimpleScheduler.java:188)
> >         ... 25 more
> >
> >
> 

Re: Threading problems with Ode

Posted by Alex Boisvert <bo...@intalio.com>.
Can you provide more information on this?   It looks like a configuration
issue wrt TransactionManager.

alex


On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
>
>
> You're right this was with ode_trunk. My first test was with version 1.1which resulted in the following error. I will now test with the sendSynch
> property.
>
> Thanks!
>
> Kristian
>
> --- 8< ---
>
> 14:51:19,018 ERROR [JacobVPU] Method "run" in class "
> org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
> org.apache.ode.bpel.iapi.ContextException: Unable to register
> synchronizer.
>         at
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> SimpleScheduler.java:200)
>         at org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java
> :119)
>         at org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(
> MessageExchangeContextImpl.java:60)
>         at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(
> BpelRuntimeContextImpl.java:794)
>         at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
>         at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(
> JacobVPU.java:451)
>         at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
>         at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> BpelRuntimeContextImpl.java:836)
>         at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(
> PartnerLinkMyRoleImpl.java:193)
>         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> BpelProcess.java:169)
>         at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> BpelProcess.java:306)
>         at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> BpelEngineImpl.java:318)
>         at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> BpelServerImpl.java:364)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> SimpleScheduler.java:335)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> SimpleScheduler.java:334)
>         at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction
> (SimpleScheduler.java:173)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:333)
>         at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:330)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> :269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.NullPointerException
>         at
> org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(
> SimpleScheduler.java:188)
>         ... 25 more
>
>

AW: Threading problems with Ode

Posted by Kristian Köhler <Kr...@dmc.de>.
Hi Alex

> Could you open a Jira issue for this bug?

Ok. I try to add a sample project for this.

> Second, you're running on ode-trunk which is currently 
> unstable.   If you
> want something more stable for load testing, I'd suggest using the
> ode-1.1branch.  With
> 1.1, you can also control whether JBI calls are made 
> synchronously (same
> thread) or asynchronously (with callback) via the "
> org.apache.ode.jbi.sendSynch" system property.   The default 
> is "false",
> meaning that calls use DeliveryChannel.send() instead of 
> sendSync().

You're right this was with ode_trunk. My first test was with version 1.1 which resulted in the following error. I will now test with the sendSynch property.

Thanks!

Kristian

--- 8< ---

14:51:19,018 ERROR [JacobVPU] Method "run" in class "org.apache.ode.bpel.runtime.INVOKE" threw an unexpected exception.
org.apache.ode.bpel.iapi.ContextException: Unable to register synchronizer.
        at org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(SimpleScheduler.java:200)
        at org.apache.ode.jbi.OdeConsumer.invokePartner(OdeConsumer.java:119)
        at org.apache.ode.jbi.MessageExchangeContextImpl.invokePartner(MessageExchangeContextImpl.java:60)
        at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeContextImpl.java:794)
        at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:96)
        at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
        at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
        at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:836)
        at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole(PartnerLinkMyRoleImpl.java:193)
        at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:169)
        at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(BpelProcess.java:306)
        at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl.java:318)
        at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl.java:364)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleScheduler.java:335)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(SimpleScheduler.java:334)
        at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:173)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:333)
        at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(SimpleScheduler.java:330)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
        at org.apache.ode.scheduler.simple.SimpleScheduler.registerSynchronizer(SimpleScheduler.java:188)
        ... 25 more

--- 8< ---



> experience so far is that sendSync() leads to better performance and
> stability under load, provided you have sufficient number of 
> threads (but
> not too much).
> 
> regards,
> alex
> 
> 
> On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
> >
> > Hi
> >
> > I encountered problems calling ode processes from multiple 
> threads. I'm
> > using ODE deployed as JBI component to servicemix running 
> within Geronimo.
> >
> > My sample is a simple BPEL process which calls a remote 
> service, also
> > deployed as JBI component to Servicemix, and returning a 
> value. I set up a
> > JMeter test which is sending SOAP requests "to" my process. 
> Running one
> > thread is no problem. Calling the process from 4 or more 
> threads results in
> > "Internal Error"s returned from ODE (not every call of course ;-) ).
> >
> > ---- 8< (start) ----
> > 09:39:45,406 FATAL [BpelServerImpl] Internal Error
> > org.apache.ode.bpel.iapi.BpelEngineException:
> > org.apache.ode.bpel.iapi.BpelEngineException: MUST RUN IN 
> TRANSACTION!
> >         at org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(
> > BpelProcess.java:423)
> >         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> > BpelProcess.java:259)
> >         at 
> org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke(
> > MyRoleMessageExchangeImpl.java:132)
> >         at
> > 
> org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(
> > UnreliableMyRoleMessageExchangeImpl.java:48
> >         at
> > 
> org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(
> > UnreliableMyRoleMessageExchangeImpl.java:47
> >         at 
> org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(
> > BpelProcess.java:1122)
> >         at org.apache.ode.bpel.engine.Contexts.execTransaction(
> > Contexts.java:118)
> >         at
> > org.apache.ode.bpel.engine.BpelServerImpl$TransactedCallable.call(
> > BpelServerImpl.java:833)
> >         at 
> org.apache.ode.bpel.engine.BpelServerImpl$ServerCallable.call(
> > BpelServerImpl.java:811)
> >         at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> > :269)
> >         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> >         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> > ThreadPoolExecutor.java:650)
> >         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> > ThreadPoolExecutor.java:675)
> >         at java.lang.Thread.run(Thread.java:595)
> > Caused by: org.apache.ode.bpel.iapi.BpelEngineException: MUST RUN IN
> > TRANSACTION!
> >         at 
> org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> > BpelRuntimeContextImpl.java:758)
> >         at 
> org.apache.ode.bpel.engine.BpelProcess.executeCreateInstance(
> > BpelProcess.java:314)
> >         at 
> org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java
> > :261)
> >         at 
> org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java
> > :260)
> >         at 
> org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(
> > BpelProcess.java:1122)
> >         at 
> org.apache.ode.bpel.engine.BpelInstanceWorker.doInstanceWork(
> > BpelInstanceWorker.java:174)
> >         at
> > org.apache.ode.bpel.engine.BpelInstanceWorker.execInCurrentThread(
> > BpelInstanceWorker.java:108)
> >         at org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(
> > BpelProcess.java:420)
> >         ... 13 more
> >
> > ---- 8< (stop) ----
> >
> > One thing i tried was to mark the '
> > org.apache.ode.bpel.engine.Contexts#execTransaction' method with the
> > synchronized keyword.
> > This worked fine but was a bit slow ;-)
> >
> > --- 8< (start) ---
> > public synchronized <T> T execTransaction(Callable<T> 
> transaction) throws
> > Exception
> > --- 8< (stop) ---
> >
> > I debugged a bit more and I it seems to me that the calling thread
> > "looses" the transaction after the
> > org.apache.ode.dao.jpa.ProcessDAOImpl#createInstance call.
> >
> > --- 8< (start) ---
> > org.apache.ode.dao.jpa.ProcessDAOImpl.createInstance(CorrelatorDAO)
> >
> > 
> org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRoleC
> reateInstance(MessageExchangeDAO,
> > Operation, String, CorrelatorDAO)
> > org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole
> > (MessageExchangeDAO)
> > 
> org.apache.ode.bpel.engine.BpelProcess.invokeProcess(MessageEx
> changeDAO)
> > org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke()
> > 
> org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl
> .invokeAsync().new
> > Callable<Void>() {...}.call()
> > --- 8< (stop) ---
> >
> > I'm working on Windows XP, Java JDK 1.5.0_12 (Sun).
> >
> > Is there any know solution to the problem? ;-)
> > Any help is welcome...
> >
> > Kristian
> >
> > ---
> > http://gaswerk.sourceforge.net
> >
> >
> >
> 

Re: Threading problems with Ode

Posted by Alex Boisvert <bo...@intalio.com>.
Hi Kristian,

Could you open a Jira issue for this bug?

Second, you're running on ode-trunk which is currently unstable.   If you
want something more stable for load testing, I'd suggest using the
ode-1.1branch.  With
1.1, you can also control whether JBI calls are made synchronously (same
thread) or asynchronously (with callback) via the "
org.apache.ode.jbi.sendSynch" system property.   The default is "false",
meaning that calls use DeliveryChannel.send() instead of sendSync().    My
experience so far is that sendSync() leads to better performance and
stability under load, provided you have sufficient number of threads (but
not too much).

regards,
alex


On 11/2/07, Kristian Köhler <Kr...@dmc.de> wrote:
>
> Hi
>
> I encountered problems calling ode processes from multiple threads. I'm
> using ODE deployed as JBI component to servicemix running within Geronimo.
>
> My sample is a simple BPEL process which calls a remote service, also
> deployed as JBI component to Servicemix, and returning a value. I set up a
> JMeter test which is sending SOAP requests "to" my process. Running one
> thread is no problem. Calling the process from 4 or more threads results in
> "Internal Error"s returned from ODE (not every call of course ;-) ).
>
> ---- 8< (start) ----
> 09:39:45,406 FATAL [BpelServerImpl] Internal Error
> org.apache.ode.bpel.iapi.BpelEngineException:
> org.apache.ode.bpel.iapi.BpelEngineException: MUST RUN IN TRANSACTION!
>         at org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(
> BpelProcess.java:423)
>         at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(
> BpelProcess.java:259)
>         at org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke(
> MyRoleMessageExchangeImpl.java:132)
>         at
> org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(
> UnreliableMyRoleMessageExchangeImpl.java:48
>         at
> org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl$1.call(
> UnreliableMyRoleMessageExchangeImpl.java:47
>         at org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(
> BpelProcess.java:1122)
>         at org.apache.ode.bpel.engine.Contexts.execTransaction(
> Contexts.java:118)
>         at
> org.apache.ode.bpel.engine.BpelServerImpl$TransactedCallable.call(
> BpelServerImpl.java:833)
>         at org.apache.ode.bpel.engine.BpelServerImpl$ServerCallable.call(
> BpelServerImpl.java:811)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
> :269)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:123)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> ThreadPoolExecutor.java:650)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:675)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: org.apache.ode.bpel.iapi.BpelEngineException: MUST RUN IN
> TRANSACTION!
>         at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(
> BpelRuntimeContextImpl.java:758)
>         at org.apache.ode.bpel.engine.BpelProcess.executeCreateInstance(
> BpelProcess.java:314)
>         at org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java
> :261)
>         at org.apache.ode.bpel.engine.BpelProcess$2.call(BpelProcess.java
> :260)
>         at org.apache.ode.bpel.engine.BpelProcess$ProcessCallable.call(
> BpelProcess.java:1122)
>         at org.apache.ode.bpel.engine.BpelInstanceWorker.doInstanceWork(
> BpelInstanceWorker.java:174)
>         at
> org.apache.ode.bpel.engine.BpelInstanceWorker.execInCurrentThread(
> BpelInstanceWorker.java:108)
>         at org.apache.ode.bpel.engine.BpelProcess.doInstanceWork(
> BpelProcess.java:420)
>         ... 13 more
>
> ---- 8< (stop) ----
>
> One thing i tried was to mark the '
> org.apache.ode.bpel.engine.Contexts#execTransaction' method with the
> synchronized keyword.
> This worked fine but was a bit slow ;-)
>
> --- 8< (start) ---
> public synchronized <T> T execTransaction(Callable<T> transaction) throws
> Exception
> --- 8< (stop) ---
>
> I debugged a bit more and I it seems to me that the calling thread
> "looses" the transaction after the
> org.apache.ode.dao.jpa.ProcessDAOImpl#createInstance call.
>
> --- 8< (start) ---
> org.apache.ode.dao.jpa.ProcessDAOImpl.createInstance(CorrelatorDAO)
>
> org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRoleCreateInstance(MessageExchangeDAO,
> Operation, String, CorrelatorDAO)
> org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeMyRole
> (MessageExchangeDAO)
> org.apache.ode.bpel.engine.BpelProcess.invokeProcess(MessageExchangeDAO)
> org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.doInvoke()
> org.apache.ode.bpel.engine.UnreliableMyRoleMessageExchangeImpl.invokeAsync().new
> Callable<Void>() {...}.call()
> --- 8< (stop) ---
>
> I'm working on Windows XP, Java JDK 1.5.0_12 (Sun).
>
> Is there any know solution to the problem? ;-)
> Any help is welcome...
>
> Kristian
>
> ---
> http://gaswerk.sourceforge.net
>
>
>