I have learned a little more about what is happening here. This morning I wrote up a jira issue and then closed it after I realized my understanding of the problem wasn't accurate. Basically, you'll get a NullPointerException if you try to reply more than once (to the same operation/partnerLink/portType). Obviously, there is no need to reply more than once, but ODE probably shouldn't throw a NullPointerException either.
-Jon -----Original Message----- From: Jonathan Coogan Sent: Tuesday, June 14, 2011 4:23 PM To: [email protected] Subject: NPE with a reply activity inside a fault handler In ODE 1.3.5 I am seeing a NullPointerException when I try to Reply from within a fault handler. I am prepared to create a jira issue if needed. Can anyone comment on this? This used to work in previous versions of ODE (I know for a fact that it worked in 1.3.2). I created a very simple BPEL process that throws and catches a user-defined fault. Within the fault handler I try to reply and I get this stacktrace: 15:53:57,357 ERROR [JacobVPU] Method "run" in class "org.apache.ode.bpel.runtime.REPLY" threw an unexpected exception. java.lang.NullPointerException at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply2(BpelRuntimeCont extImpl.java:603) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply(BpelRuntimeConte xtImpl.java:589) at org.apache.ode.bpel.runtime.REPLY.run(REPLY.java:68) at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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(BpelRuntimeCon textImpl.java:968) at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(Partn erLinkMyRoleImpl.java:208) at org.apache.ode.bpel.engine.BpelProcess$1.invoke(BpelProcess.java:283) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:23 8) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:27 9) at org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.java :426) at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl. java:460) at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl. java:450) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:518) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:284) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:239) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:496) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:908) at java.lang.Thread.run(Thread.java:662) 15:53:57,468 ERROR [BpelEngineImpl] Scheduled job failed; jobDetail=JobDetails( instanceId: null mexId: 4611686018427387903 processId: {test}FaultHandlerReplyNPE-1 type: INVOKE_INTERNAL channel: null correlatorId: null correlationKeySet: null retryCount: null inMem: true detailsExt: {}) java.lang.RuntimeException: java.lang.NullPointerException at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:464) at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeCon textImpl.java:968) at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(Partn erLinkMyRoleImpl.java:208) at org.apache.ode.bpel.engine.BpelProcess$1.invoke(BpelProcess.java:283) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:23 8) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:27 9) at org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.java :426) at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl. java:460) at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl. java:450) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:518) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:284) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:239) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:496) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.NullPointerException at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply2(BpelRuntimeCont extImpl.java:603) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply(BpelRuntimeConte xtImpl.java:589) at org.apache.ode.bpel.runtime.REPLY.run(REPLY.java:68) at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451) ... 20 more 15:53:57,567 WARN [MyRoleMessageExchangeImpl] Transaction is rolled back on sending back the response. 15:53:58,576 FATAL [BpelRuntimeContextImpl] Engine requested response while the message exchange 4611686018427387903 was in the state RESPONSE 15:53:58,580 ERROR [PICK] The message exchange seems to be in an unconsistent state, you're probably missing a reply on a request/response interaction. 15:53:58,590 ERROR [JacobVPU] Method "run" in class "org.apache.ode.bpel.runtime.REPLY" threw an unexpected exception. java.lang.IllegalStateException: Not in REQUEST state! at org.apache.ode.bpel.engine.MessageExchangeImpl.setResponse(MessageExchan geImpl.java:171) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply2(BpelRuntimeCont extImpl.java:609) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply(BpelRuntimeConte xtImpl.java:589) at org.apache.ode.bpel.runtime.REPLY.run(REPLY.java:68) at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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(BpelRuntimeCon textImpl.java:968) at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(Partn erLinkMyRoleImpl.java:208) at org.apache.ode.bpel.engine.BpelProcess$1.invoke(BpelProcess.java:283) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:23 8) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:27 9) at org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.java :426) at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl. java:460) at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl. java:450) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:518) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:284) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:239) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:496) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:908) at java.lang.Thread.run(Thread.java:662) 15:53:58,642 ERROR [BpelEngineImpl] Scheduled job failed; jobDetail=JobDetails( instanceId: null mexId: 4611686018427387903 processId: {test}FaultHandlerReplyNPE-1 type: INVOKE_INTERNAL channel: null correlatorId: null correlationKeySet: null retryCount: null inMem: true detailsExt: {}) java.lang.RuntimeException: java.lang.IllegalStateException: Not in REQUEST state! at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:464) at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeCon textImpl.java:968) at org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeNewInstance(Partn erLinkMyRoleImpl.java:208) at org.apache.ode.bpel.engine.BpelProcess$1.invoke(BpelProcess.java:283) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:23 8) at org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:27 9) at org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.java :426) at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl. java:460) at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl. java:450) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:518) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleSche duler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:284) at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleSc heduler.java:239) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:512) at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleSchedu ler.java:496) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto r.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.IllegalStateException: Not in REQUEST state! at org.apache.ode.bpel.engine.MessageExchangeImpl.setResponse(MessageExchan geImpl.java:171) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply2(BpelRuntimeCont extImpl.java:609) at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.reply(BpelRuntimeConte xtImpl.java:589) at org.apache.ode.bpel.runtime.REPLY.run(REPLY.java:68) at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451) ... 20 more 15:53:59,697 FATAL [BpelRuntimeContextImpl] Engine requested response while the message exchange 4611686018427387903 was in the state RESPONSE 15:53:59,701 ERROR [PICK] The message exchange seems to be in an unconsistent state, you're probably missing a reply on a request/response interaction. 15:53:59,711 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering activity 4, failure reason: org.apache.ode.bpel.iapi.BpelEngineException: Engine requested response while the message exchange 4611686018427387903 was in the state RESPONSE on channel 10 Thanks. -Jon Coogan
