It looks like I am hitting the same bug as http://issues.apache.org/jira/browse/AXIS2-3265

Any solution?

Thanks.


Huitang Li wrote:
I mean the run() method in the private class NonBlockingInvocationWorker in class OutInAxisOperationClient.

private class NonBlockingInvocationWorker implements java.lang.Runnable{
       private org.apache.axis2.client.async.Callback callback;
       private org.apache.axis2.context.MessageContext msgctx;
       private org.apache.axis2.client.async.AxisCallback axisCallback;
public NonBlockingInvocationWorker(org.apache.axis2.client.async.Callback callback, org.apache.axis2.context.MessageContext messageContext, org.apache.axis2.client.async.AxisCallback axisCallback) { /* compiled code */ } public void run() { /* compiled code */ } <============= this line of code
   }



Huitang Li wrote:

With further debugging, I found something interesting: when the onMessage() method is done in AxisCallback, the application proceeds on the method "public void run() " in class OutInAxisOperationClient, and then somehow the application seems hanging for ever.

I have not downloaded the axis2 source code to debug, but I believe that something is not right after the AxisCallback finishes onMessage() and then returns the control to the run() method in OutInAxisOperationClient.


Thanks.



Rajith Attapattu wrote:
Put you notification logic in the

 public void onComplete() {
                //nothing here
            }

So when it completes (either fault/error or sucess) , this method will be called.

Here is a faily elementry example (not the most elegant)
Modify the generated class as follows.

 public void onComplete() {
                _complete = true;
            }

and add a isComplete Method

boolean isComplete()
{
  return _complete;
}

you can now use it like the old Callback class.

while ( !_axisCallBack.isComplete())
{
   Thread.sleep(1000);
}

Hope this helps.

On 10/12/07, *Huitang Li* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Thanks, Deepal. I will be happy to create a JRIA. But can you show
    me a
good example using this new API in the client code? I am working on a
    project, and I cannot wait for the next Axis2 release.

    Thanks.

    Huitang



    Deepal jayasinghe wrote:
    > Hi Huitang ,
    > Definitely a bug in codegen , please create a JRIA.
    >
    > Thanks
    > Deepal
    >
    >> All these codes are auto-generated by Axis2 1.3 wsdl2java
    command. I
>> do not know whether it is an old callback or not. But it does says:
    >>
    >> _operationClient.setCallback(new
    >> org.apache.axis2.client.async.AxisCallback() {
    >> // all the codes that I pasted in my previous email.
    >> }
    >>
    >> In the generated code, the onComplete() method looks like this:
    >>
    >> public void onComplete() {
    >>                    // Do nothing by default
    >>                }
    >>
    >>
    >> Maybe there is something incorrectly generated by wsdl2java?
    >>
    >>
    >>
    >>
    >> Rajith Attapattu wrote:
    >>
    >>> What do you mean by the "application is stuck" ? How does your
    >>> application figure out if a response is received?
    >>> Can you please cut paste the code that uses the AxisCallback.
    >>>
    >>> Does the onMessage, onError or onFault methods get called?
    >>> If so why do u say it is stuck?
    >>>
    >>> Looks like the onMessage and onError methods get called, bcos
    u seem
    >>> to have put the old callback there and you mentioned that it
    works.
    >>>
    >>>
    >>>                 public void onComplete() {
    >>>                     //nothing here
    >>>                 }
    >>>
    >>>
    >>> I also see that the onComplete method is empty.
    >>>
    >>> --
    >>> Rajith Attapattu
    >>> Red Hat
    >>> Blog http://mutlix.blogspot.com/
    >>>
    >>
---------------------------------------------------------------------
    >> To unsubscribe, e-mail: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    >> For additional commands, e-mail: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    >>
    >>
    >>
    >
    >
    >

---------------------------------------------------------------------
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    For additional commands, e-mail: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>




--
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to