You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Dan <le...@gmail.com> on 2007/07/31 04:55:32 UTC

explicit correlation - NullPointerException - receive behavior

Hi,
I'm trying out explicit correlations.  My sequence is essentially two sets
of recieve, invoke, and reply sets with correlations on the receives.  My
assumption is that receive will block until a message arrives.  What seems
to happen though is that the second receive is entered before an actual
message is received which triggers a correlation error.  Should receive
block until a message arrives?

Here's the pseudo code of what I'm doing followed by the exception.
(servicemix 3.0, ode r553562 (ca. July 8), Fedora 6)

<sequence>
   <receive messageA>  <correlation transactionID>
   <invoke serviceA>
   <reply requestA>   <<-- reply makes it back to the client

<<exception thrown around this time before messageB is ever sent by the
client>>

   <receive messageB> <correlation transactionID>
   <invoke serviceB>
   <reply requestB>
</sequence>
-------------------------------------------------------
19:03:29,980 | DEBUG | pool-flow.seda.OdeBpelEngine-thread-54 |
ConsumerProcessor        | p.processors.ConsumerProcessor   98 | Resuming
continuation for exchange: ID:localhost.localdomain-41761-1185806196813-2:34
19:03:29,979 | ERROR | pool-2-thread-30 | BpelEngineImpl           |
ode.bpel.engine.BpelEngineImpl  325 | Scheduled job failed;
jobDetail={type=MATCHER, inmem=true, ckey=null, correlatorId=
30.ProxyServiceB, iid=12}
java.lang.NullPointerException
    at org.apache.ode.bpel.common.CorrelationKey.<init>(CorrelationKey.java
:71)
    at org.apache.ode.bpel.engine.WorkEvent.getCorrelationKey(WorkEvent.java
:97)
    at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
BpelProcess.java:341)
    at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
BpelEngineImpl.java:316)
    at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
BpelServerImpl.java:364)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
SimpleScheduler.java:316)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
SimpleScheduler.java:315)
    at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
SimpleScheduler.java:154)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
SimpleScheduler.java:314)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
SimpleScheduler.java:311)
    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)
19:03:29,985 | ERROR | pool-2-thread-30 | SimpleScheduler          |
duler.simple.SimpleScheduler$4  328 | Error while executing transaction
org.apache.ode.bpel.iapi.Scheduler$JobProcessorException:
java.lang.NullPointerException
    at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
BpelEngineImpl.java:326)
    at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
BpelServerImpl.java:364)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
SimpleScheduler.java:316)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
SimpleScheduler.java:315)
    at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
SimpleScheduler.java:154)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
SimpleScheduler.java:314)
    at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
SimpleScheduler.java:311)
    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.bpel.common.CorrelationKey.<init>(CorrelationKey.java
:71)
    at org.apache.ode.bpel.engine.WorkEvent.getCorrelationKey(WorkEvent.java
:97)
    at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
BpelProcess.java:341)
    at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
BpelEngineImpl.java:316)
    ... 11 more
19:03:29,986 | DEBUG | btpool0-0 - Acceptor0 SelectChannelConnector @
0.0.0.0:8080 | JettyContextManager      | ntextManager$ThreadPoolWrapper
437 | Dispatching job: HEP@21218523[d=true,io=0,w=true,b=0|0]
19:03:29,986 | DEBUG | btpool0-44 | jetty                    |
ervicemix.http.jetty.JCLLogger   67 | resume continuation
org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation@9e032

Re: explicit correlation - NullPointerException - receive behavior

Posted by Dan <le...@gmail.com>.
Thanks, Matthieu.  The example is helpful.
The main problem with my correlation was that I had inadvertently set
'initiate="yes"' in the second receive.

However, now that I have that resolved, I still can't get the second message
into the process instance.  When I send the second message nothing happens,
and I get an exchange not found error.  Does servicemix have to somehow be
aware of the correlation, or is that all taken care of by Ode?  (Both
messages arrive from the same http endpoint invoking different operations of
the same portType).

Unfortunately I don't think there's not much in the log to work from:
(First request/response processed; Second message received by Jetty...)
DEBUG - SedaQueue                      -
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@83fc73 dequeued
exchange: InOut[
  id: ID:localhost.localdomain-55865-1185912754162-3:10
  status: Active
  role: provider
...blah blah message inards blah blah...
]
DEBUG - DeliveryChannelImpl            - Accepting ID:
localhost.localdomain-55865-1185912754162-3:10 in
DeliveryChannel{OdeBpelEngine}
<<Long wait here.  Then Jetty seems to give up.>>
DEBUG - JettyContextManager            - Dispatching job: HEP@26922259
[d=true,io=0,w=true,b=0|0]
DEBUG - jetty                          - resume continuation
org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation@19f9744
...blah blah jetty stuff blah blah...
WARN  - jetty                          -
/DansCorrelationExample/DansService/:
java.lang.IllegalStateException: Exchange not found
        at org.apache.servicemix.http.processors.ConsumerProcessor.process(
ConsumerProcessor.java:206)
        at org.apache.servicemix.http.HttpBridgeServlet.doPost(
HttpBridgeServlet.java:71)

Thanks,
Dan

On 7/31/07, Matthieu Riou <ma...@gmail.com> wrote:
>
> Hi Dan,
>
> The receive definitely waits until a message pops up but we still need to
> prepare some sort of "listener" that will get notified when your message
> arrives and that piece needs to know about the correlation. So it's not
> that
> the really receive starts executing, it's just that it can't initialize
> probably because there's a problem with your correlation definition.
>
> We have a sample that uses correlations for process to process
> communication
> here if you want to have a look:
>
>
> http://svn.apache.org/repos/asf/ode/trunk/distro-axis2/src/examples/DynPartner/DynPartnerMain.bpel
>
> I'd be curious to know what exactly is the problem with your correlation,
> it's hard to track down from the logs but I'd be happy to add a checked
> exception.
>
> Thanks,
> Matthieu
>
> On 7/30/07, Dan <le...@gmail.com> wrote:
> >
> > Hi,
> > I'm trying out explicit correlations.  My sequence is essentially two
> sets
> > of recieve, invoke, and reply sets with correlations on the
> receives.  My
> > assumption is that receive will block until a message arrives.  What
> seems
> > to happen though is that the second receive is entered before an actual
> > message is received which triggers a correlation error.  Should receive
> > block until a message arrives?
> >
> > Here's the pseudo code of what I'm doing followed by the exception.
> > (servicemix 3.0, ode r553562 (ca. July 8), Fedora 6)
> >
> > <sequence>
> >    <receive messageA>  <correlation transactionID>
> >    <invoke serviceA>
> >    <reply requestA>   <<-- reply makes it back to the client
> >
> > <<exception thrown around this time before messageB is ever sent by the
> > client>>
> >
> >    <receive messageB> <correlation transactionID>
> >    <invoke serviceB>
> >    <reply requestB>
> > </sequence>
> > -------------------------------------------------------
> > 19:03:29,980 | DEBUG | pool-flow.seda.OdeBpelEngine-thread-54 |
> > ConsumerProcessor        | p.processors.ConsumerProcessor   98 |
> Resuming
> > continuation for exchange: ID:
> localhost.localdomain-41761-1185806196813-2
> > :34
> > 19:03:29,979 | ERROR | pool-2-thread-30 | BpelEngineImpl           |
> > ode.bpel.engine.BpelEngineImpl  325 | Scheduled job failed;
> > jobDetail={type=MATCHER, inmem=true, ckey=null, correlatorId=
> > 30.ProxyServiceB, iid=12}
> > java.lang.NullPointerException
> >     at org.apache.ode.bpel.common.CorrelationKey.<init>(
> > CorrelationKey.java
> > :71)
> >     at org.apache.ode.bpel.engine.WorkEvent.getCorrelationKey(
> > WorkEvent.java
> > :97)
> >     at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > BpelProcess.java:341)
> >     at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > BpelEngineImpl.java:316)
> >     at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > BpelServerImpl.java:364)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > SimpleScheduler.java:316)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > SimpleScheduler.java:315)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > SimpleScheduler.java:154)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:314)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:311)
> >     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)
> > 19:03:29,985 | ERROR | pool-2-thread-30 | SimpleScheduler          |
> > duler.simple.SimpleScheduler$4  328 | Error while executing transaction
> > org.apache.ode.bpel.iapi.Scheduler$JobProcessorException:
> > java.lang.NullPointerException
> >     at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > BpelEngineImpl.java:326)
> >     at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> > BpelServerImpl.java:364)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > SimpleScheduler.java:316)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> > SimpleScheduler.java:315)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> > SimpleScheduler.java:154)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:314)
> >     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> > SimpleScheduler.java:311)
> >     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.bpel.common.CorrelationKey.<init>(
> > CorrelationKey.java
> > :71)
> >     at org.apache.ode.bpel.engine.WorkEvent.getCorrelationKey(
> > WorkEvent.java
> > :97)
> >     at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> > BpelProcess.java:341)
> >     at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> > BpelEngineImpl.java:316)
> >     ... 11 more
> > 19:03:29,986 | DEBUG | btpool0-0 - Acceptor0 SelectChannelConnector @
> > 0.0.0.0:8080 | JettyContextManager      | ntextManager$ThreadPoolWrapper
> > 437 | Dispatching job: HEP@21218523[d=true,io=0,w=true,b=0|0]
> > 19:03:29,986 | DEBUG | btpool0-44 | jetty                    |
> > ervicemix.http.jetty.JCLLogger   67 | resume continuation
> > org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation@9e032
> >
>

Re: explicit correlation - NullPointerException - receive behavior

Posted by Matthieu Riou <ma...@gmail.com>.
Hi Dan,

The receive definitely waits until a message pops up but we still need to
prepare some sort of "listener" that will get notified when your message
arrives and that piece needs to know about the correlation. So it's not that
the really receive starts executing, it's just that it can't initialize
probably because there's a problem with your correlation definition.

We have a sample that uses correlations for process to process communication
here if you want to have a look:

http://svn.apache.org/repos/asf/ode/trunk/distro-axis2/src/examples/DynPartner/DynPartnerMain.bpel

I'd be curious to know what exactly is the problem with your correlation,
it's hard to track down from the logs but I'd be happy to add a checked
exception.

Thanks,
Matthieu

On 7/30/07, Dan <le...@gmail.com> wrote:
>
> Hi,
> I'm trying out explicit correlations.  My sequence is essentially two sets
> of recieve, invoke, and reply sets with correlations on the receives.  My
> assumption is that receive will block until a message arrives.  What seems
> to happen though is that the second receive is entered before an actual
> message is received which triggers a correlation error.  Should receive
> block until a message arrives?
>
> Here's the pseudo code of what I'm doing followed by the exception.
> (servicemix 3.0, ode r553562 (ca. July 8), Fedora 6)
>
> <sequence>
>    <receive messageA>  <correlation transactionID>
>    <invoke serviceA>
>    <reply requestA>   <<-- reply makes it back to the client
>
> <<exception thrown around this time before messageB is ever sent by the
> client>>
>
>    <receive messageB> <correlation transactionID>
>    <invoke serviceB>
>    <reply requestB>
> </sequence>
> -------------------------------------------------------
> 19:03:29,980 | DEBUG | pool-flow.seda.OdeBpelEngine-thread-54 |
> ConsumerProcessor        | p.processors.ConsumerProcessor   98 | Resuming
> continuation for exchange: ID:localhost.localdomain-41761-1185806196813-2
> :34
> 19:03:29,979 | ERROR | pool-2-thread-30 | BpelEngineImpl           |
> ode.bpel.engine.BpelEngineImpl  325 | Scheduled job failed;
> jobDetail={type=MATCHER, inmem=true, ckey=null, correlatorId=
> 30.ProxyServiceB, iid=12}
> java.lang.NullPointerException
>     at org.apache.ode.bpel.common.CorrelationKey.<init>(
> CorrelationKey.java
> :71)
>     at org.apache.ode.bpel.engine.WorkEvent.getCorrelationKey(
> WorkEvent.java
> :97)
>     at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> BpelProcess.java:341)
>     at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> BpelEngineImpl.java:316)
>     at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> BpelServerImpl.java:364)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> SimpleScheduler.java:316)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> SimpleScheduler.java:315)
>     at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> SimpleScheduler.java:154)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:314)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:311)
>     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)
> 19:03:29,985 | ERROR | pool-2-thread-30 | SimpleScheduler          |
> duler.simple.SimpleScheduler$4  328 | Error while executing transaction
> org.apache.ode.bpel.iapi.Scheduler$JobProcessorException:
> java.lang.NullPointerException
>     at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> BpelEngineImpl.java:326)
>     at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(
> BpelServerImpl.java:364)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> SimpleScheduler.java:316)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4$1.call(
> SimpleScheduler.java:315)
>     at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(
> SimpleScheduler.java:154)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:314)
>     at org.apache.ode.scheduler.simple.SimpleScheduler$4.call(
> SimpleScheduler.java:311)
>     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.bpel.common.CorrelationKey.<init>(
> CorrelationKey.java
> :71)
>     at org.apache.ode.bpel.engine.WorkEvent.getCorrelationKey(
> WorkEvent.java
> :97)
>     at org.apache.ode.bpel.engine.BpelProcess.handleWorkEvent(
> BpelProcess.java:341)
>     at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(
> BpelEngineImpl.java:316)
>     ... 11 more
> 19:03:29,986 | DEBUG | btpool0-0 - Acceptor0 SelectChannelConnector @
> 0.0.0.0:8080 | JettyContextManager      | ntextManager$ThreadPoolWrapper
> 437 | Dispatching job: HEP@21218523[d=true,io=0,w=true,b=0|0]
> 19:03:29,986 | DEBUG | btpool0-44 | jetty                    |
> ervicemix.http.jetty.JCLLogger   67 | resume continuation
> org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation@9e032
>