You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by jayachandra <ja...@gmail.com> on 2005/09/02 12:48:51 UTC

[Axis2] invokeBlocking() problems in Axis2

Hi!
 When I invoked a call.invokeBlocking() routine, internally it is simulated 
using invokeNonBlocking() using a call back mechanism. However, even though 
the server sent a valid response (this I verified with TCPmon) the call back 
class is not getting properly updated with the result. Is this a known 
issue? Can someone clarify this. The error I am getting is...
 
Time out while waiting for the server to send the response

at org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(
InOutMEPClient.java:144)

at org.apache.axis2.clientapi.Call.invokeBlocking(Call.java:89)

at org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:72)
which essentially is arising from the code block in
InOutMEPClient.javawhich looks like follows.
(Line Numbers 135 to 146 of InOutMEPClient.invokeBlocking() method) ::
  while (!callback.isComplete()) {
//wait till the reponse arrives
if (index++ < 20) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new AxisFault(e);
}
} else {
throw new AxisFault(Messages.getMessage("responseTimeOut")); << This is the 
reported error
}
}
Any help in this regard will be much appreciated.
 Thanks
Jayachandra
-- 
-- Jaya

Re: [Axis2] invokeBlocking() problems in Axis2

Posted by jayachandra <ja...@gmail.com>.
Ajith and Saminda, thanks for replying. However, the problem still persists
@Ajith!
The response is almost instantaneous. Also to be on safe side I did make the 
while loop run hundred times longer by increasing the Thread.sleep(100 times 
the original value). Still no luck!
@Saminda!
Saminda, nowhere in my application I was calling a call.close() at all. Even 
in the execution flow of underlying Axis2 code nowhere call.close() was 
called either. There is no close() method in the Call.java in my code base. 
Did that get added very recently?
 Some notes of my observations of what Axis2 is doing on the client side.
(i) CommonsHTTPSender is the underlying handler that did the job of finally 
sending the content to the endpoint and also it did get back a valid 
response as an inputstream
(ii) Next in its processResponse() method commonsHTTPSender put the response 
inputstream into msgContext as the value of TRANSPORT_IN property.
 msgContext.getOperationContext().setProperty(
MessageContext.TRANSPORT_IN,
in);
 (iii) But nowhere after that, this TRANSPORT_IN property is read by anyone 
to read and update the call back.
 Shouldn't there be an invocation of receiver to read in the response 
inputstream somewhere *after* engine.send() is fired.
 Can someone look into this or suggest some work around, if any, for now
 Thanks
Jayachandra
 On 9/2/05, Ajith Ranabahu <aj...@gmail.com> wrote: 
> 
> Hmmm..
> Perhaps the timeout is not enough. We definiltely have to introduce a 
> configurable timeout here. BTW have you tried increasing the timeout ? 
> 
> On 9/2/05, jayachandra <jayachandra@gmail.com > wrote: 
> > 
> > Hi!
> >  When I invoked a call.invokeBlocking() routine, internally it is 
> > simulated using invokeNonBlocking() using a call back mechanism. However, 
> > even though the server sent a valid response (this I verified with TCPmon) 
> > the call back class is not getting properly updated with the result. Is this 
> > a known issue? Can someone clarify this. The error I am getting is... 
> >  
> > Time out while waiting for the server to send the response
> > 
> > at org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(
> > InOutMEPClient.java:144)
> > 
> > at org.apache.axis2.clientapi.Call.invokeBlocking(Call.java:89)
> > 
> > at org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java
> > :72)
> > which essentially is arising from the code block in InOutMEPClient.javawhich looks like follows. (Line 
> > Numbers 135 to 146 of InOutMEPClient.invokeBlocking() method) ::
> >   while (!callback.isComplete()) {
> > //wait till the reponse arrives
> > if (index++ < 20) {
> > try {
> > Thread.sleep(100);
> > } catch (InterruptedException e) { 
> > throw new AxisFault(e);
> > }
> > } else {
> > throw new AxisFault(Messages.getMessage("responseTimeOut")); << This is 
> > the reported error
> > }
> > }
> > Any help in this regard will be much appreciated.
> >  Thanks
> > Jayachandra
> > -- 
> > -- Jaya 
> > 
> 
> 
> 
> -- 
> Ajith Ranabahu 




-- 
-- Jaya

Re: [Axis2] invokeBlocking() problems in Axis2

Posted by Saminda Abeyruwan <sa...@opensource.lk>.
Ajith Ranabahu wrote:

> Hmmm..
> Perhaps the timeout is not enough. We definiltely have to introduce a 
> configurable timeout here. BTW have you tried increasing the timeout ?
>
> On 9/2/05, *jayachandra* <jayachandra@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi!
>      
>     When I invoked a call.invokeBlocking() routine, internally it is
>     simulated using invokeNonBlocking() using a call back mechanism.
>     However, even though the server sent a valid response (this I
>     verified with TCPmon) the call back class is not getting properly
>     updated with the result. Is this a known issue? Can someone
>     clarify this. The error I am getting is...
>      
>
>     Time out while waiting for the server to send the response
>
>     at
>     org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(InOutMEPClient.java:144)
>
>     at org.apache.axis2.clientapi.Call.invokeBlocking(Call.java:89)
>
>     at
>     org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:72)
>
>     which essentially is arising from the code block in
>     InOutMEPClient.java which looks like follows.
>     (Line Numbers 135 to 146 of InOutMEPClient.invokeBlocking() method) ::
>      
>              while (!callback.isComplete()) {
>                     //wait till the reponse arrives
>                     if (index++ < 20) {
>                         try {
>                             Thread.sleep(100);
>                         } catch (InterruptedException e) {
>                             throw new AxisFault(e);
>                         }
>                     } else {
>                         throw new
>     AxisFault(Messages.getMessage("responseTimeOut"));  << This is the
>     reported error
>                     }
>                 }
>     Any help in this regard will be much appreciated.
>      
>     Thanks
>     Jayachandra
>     -- 
>     -- Jaya
>
>
>
>
> -- 
> Ajith Ranabahu 

Please make sure that you are not calling "call.close()" in application 
level. The logic behind this method is incorrect.  JIRA has been put on 
this issue. (http://issues.apache.org/jira/browse/AXIS2-191).

Saminda

Re: [Axis2] invokeBlocking() problems in Axis2

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hmmm..
Perhaps the timeout is not enough. We definiltely have to introduce a 
configurable timeout here. BTW have you tried increasing the timeout ?

On 9/2/05, jayachandra <ja...@gmail.com> wrote:
> 
> Hi!
>  When I invoked a call.invokeBlocking() routine, internally it is 
> simulated using invokeNonBlocking() using a call back mechanism. However, 
> even though the server sent a valid response (this I verified with TCPmon) 
> the call back class is not getting properly updated with the result. Is this 
> a known issue? Can someone clarify this. The error I am getting is... 
>  
> Time out while waiting for the server to send the response
> 
> at org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(
> InOutMEPClient.java:144)
> 
> at org.apache.axis2.clientapi.Call.invokeBlocking(Call.java:89)
> 
> at org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java
> :72)
> which essentially is arising from the code block in InOutMEPClient.javawhich looks like follows. (Line 
> Numbers 135 to 146 of InOutMEPClient.invokeBlocking() method) ::
>   while (!callback.isComplete()) {
> //wait till the reponse arrives
> if (index++ < 20) {
> try {
> Thread.sleep(100);
> } catch (InterruptedException e) { 
> throw new AxisFault(e);
> }
> } else {
> throw new AxisFault(Messages.getMessage("responseTimeOut")); << This is 
> the reported error
> }
> }
> Any help in this regard will be much appreciated.
>  Thanks
> Jayachandra
> -- 
> -- Jaya 
> 



-- 
Ajith Ranabahu

Re: [Axis2] invokeBlocking() problems in Axis2

Posted by Saminda Abeyruwan <sa...@opensource.lk>.
Eran Chinthaka wrote:

> hang on, I'm not allowing you to escape like that :).
>
> I just did a small fix to the code now. Can u please check whether 
> your non-blocking scenario with separate listeners runs now ? Thilina 
> also had the same problem.
>
> -- Chinthaka
>
> jayachandra wrote:
>
>> Yes guys!
>> the application i was testing erroneously set its useSeperateListener 
>> to true. I've changed it, and things are running fine now.
>>  
>> Thanks for all your help!
>>  
>> Bye
>> Jaya
>>  
>> On 9/2/05, *Eran Chinthaka* <chinthaka@opensource.lk 
>> <ma...@opensource.lk>> wrote:
>>
>>     Hi Jaya,
>>
>>     Please see my comments below.
>>
>>     jayachandra wrote:
>>
>>     > Hi!
>>     >
>>     > When I invoked a call.invokeBlocking() routine, internally it is
>>     > simulated using invokeNonBlocking() using a call back mechanism.
>>
>>     invokeBlocking() will use invokeNonBlocking() if you send and receive
>>     using two different instances of transports. In the other case,
>>     meaning
>>     when you use the same transport to send and receive, we are not using
>>     invokeNonBlocking() for invokeBlocking case. Just a small
>>     clarification ;).
>>
>>     Regards,
>>     Chinthaka
>>
>>
>>
>>
>>
>> -- 
>> -- Jaya 
>
Chinthaka is right. Even when you set to use  duel channel your code 
should work. But make sure if you are using invokeBlocking() or 
invokeNonBloking() with duel channel, for the time being not to call 
"call.close()". It will cause the trouble.

Saminda

Re: [Axis2] invokeBlocking() problems in Axis2

Posted by Eran Chinthaka <ch...@opensource.lk>.
hang on, I'm not allowing you to escape like that :).

I just did a small fix to the code now. Can u please check whether your 
non-blocking scenario with separate listeners runs now ? Thilina also 
had the same problem.

-- Chinthaka

jayachandra wrote:

> Yes guys!
> the application i was testing erroneously set its useSeperateListener 
> to true. I've changed it, and things are running fine now.
>  
> Thanks for all your help!
>  
> Bye
> Jaya
>  
> On 9/2/05, *Eran Chinthaka* <chinthaka@opensource.lk 
> <ma...@opensource.lk>> wrote:
>
>     Hi Jaya,
>
>     Please see my comments below.
>
>     jayachandra wrote:
>
>     > Hi!
>     >
>     > When I invoked a call.invokeBlocking() routine, internally it is
>     > simulated using invokeNonBlocking() using a call back mechanism.
>
>     invokeBlocking() will use invokeNonBlocking() if you send and receive
>     using two different instances of transports. In the other case,
>     meaning
>     when you use the same transport to send and receive, we are not using
>     invokeNonBlocking() for invokeBlocking case. Just a small
>     clarification ;).
>
>     Regards,
>     Chinthaka
>
>
>
>
>
> -- 
> -- Jaya 


Re: [Axis2] invokeBlocking() problems in Axis2

Posted by jayachandra <ja...@gmail.com>.
Yes guys!
the application i was testing erroneously set its useSeperateListener to 
true. I've changed it, and things are running fine now.
 Thanks for all your help!
 Bye
Jaya
 On 9/2/05, Eran Chinthaka <ch...@opensource.lk> wrote: 
> 
> Hi Jaya,
> 
> Please see my comments below.
> 
> jayachandra wrote:
> 
> > Hi!
> >
> > When I invoked a call.invokeBlocking() routine, internally it is
> > simulated using invokeNonBlocking() using a call back mechanism.
> 
> invokeBlocking() will use invokeNonBlocking() if you send and receive
> using two different instances of transports. In the other case, meaning
> when you use the same transport to send and receive, we are not using
> invokeNonBlocking() for invokeBlocking case. Just a small clarification 
> ;).
> 
> Regards,
> Chinthaka
> 
> 
> 


-- 
-- Jaya

Re: [Axis2] invokeBlocking() problems in Axis2

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Jaya,

Please see my comments below.

jayachandra wrote:

> Hi!
>  
> When I invoked a call.invokeBlocking() routine, internally it is 
> simulated using invokeNonBlocking() using a call back mechanism.

invokeBlocking() will use invokeNonBlocking() if you send and receive 
using two different instances of transports. In the other case, meaning 
when you use the same transport to send and receive, we are not using 
invokeNonBlocking() for invokeBlocking case. Just a small clarification ;).

Regards,
Chinthaka



Re: [Axis2] invokeBlocking() problems in Axis2

Posted by Venkat Reddy <vr...@gmail.com>.
Why would a call to invokeBlocking() end up in
call.invokeNonBlocking() ?? If Axis want to complete both synch and
asynch calls as asynch calls internally, this should be transparant to
the user, who should not be botherd to provide a callback.

- Venkat


On 9/2/05, jayachandra <ja...@gmail.com> wrote:
> Hi! 
>   
> When I invoked a call.invokeBlocking() routine, internally it is simulated
> using invokeNonBlocking() using a call back mechanism. However, even though
> the server sent a valid response (this I verified with TCPmon) the call back
> class is not getting properly updated with the result. Is this a known
> issue? Can someone clarify this. The error I am getting is... 
>   
> 
> Time out while waiting for the server to send the response 
> 
> at
> org.apache.axis2.clientapi.InOutMEPClient.invokeBlocking(InOutMEPClient.java:144)
> 
> at
> org.apache.axis2.clientapi.Call.invokeBlocking(Call.java:89)
> 
> at
> org.apache.axis2.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:72)
> which essentially is arising from the code block in InOutMEPClient.java
> which looks like follows. 
> (Line Numbers 135 to 146 of InOutMEPClient.invokeBlocking() method) :: 
>   
>          while (!callback.isComplete()) {
>                 //wait till the reponse arrives
>                 if (index++ < 20) {
>                     try {
>                         Thread.sleep(100);
>                     } catch (InterruptedException e) { 
>                         throw new AxisFault(e);
>                     }
>                 } else {
>                     throw new
> AxisFault(Messages.getMessage("responseTimeOut"));  << This is the reported
> error
>                 }
>             }
>  
> Any help in this regard will be much appreciated. 
>   
> Thanks 
> Jayachandra
> -- 
> -- Jaya