You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Michael Sutter <Mi...@ipe.fzk.de> on 2008/08/28 18:53:46 UTC

Periodic query of client

Hello list,

I have a strange problem with a Axis2 service and the corresponding 
client and maybe somebody
can help me understanding what I'm doing wrong.

I have a status service implemented with Axis2C running under a tomcat 
and the corresponding Java
client for accessing the service. The java client is called every ten 
seconds from a thread and I can
access the service without any problems.

The problem is when the thread is running for some hours - normally 
between two or four I got a AxisFault
with the message: Too many open files. First I thought that the service 
is implemented wrong, but this isn't
the problem. I monitored the client and there I saw that on the client 
side the number of open files increases.

The thread is implemented as follows:
//instantiate the stub for the service
statusStub = new Stub(..);

after that I query the service every ten seconds until a boolean is set 
to false from outside
 while (!bStopThread) {
     resp = statusStub.getStatus();
     staResp = resp.get_return();
     Thread.currentThread().sleep(lStatusQueryTime);
}

When I do this I can monitor that the number of open files increases and 
so I get the AxisFault
after some hours of runtime.

Have I done something wrong in my code? Have I to release some objects 
or to instantiate the stub
for every request? I don't understand whats my error.

Kind regards
Michael

Re: Periodic query of client

Posted by keith chapman <ke...@gmail.com>.
Hi Michael,

Nice to hear that you solved your issue. You cant find quite a few articles
on wso2.org which relate to Axis2/Java as well as Axis2/C

Thanks,
Keith.

On Tue, Sep 2, 2008 at 2:42 PM, Michael Sutter <Mi...@ipe.fzk.de>wrote:

>  Hello Keith,
>
> thanks for your hint. It seems that the reuse solves my problems.
> Also thanks for the link, by searching I found nothing which seems
> to solve my problem, but the link is very useful for my development .
>
> Kind regards
> Michael
>
>
> keith chapman wrote:
>
> Hi Michael,
>
> I think I gave you a reply on a different thread. But as you have
> specified your client code here its more clearer to me now. In this
> scenario it might help if you set the following property [1],
>
> stub._getServiceClient().getOptions.setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
> true);
>
> Thanks,
> Keith.
>
> [1] http://wso2.org/library/230#REUSE_HTTP_CLIENT
>
> On Thu, Aug 28, 2008 at 10:23 PM, Michael Sutter<Mi...@ipe.fzk.de> <Mi...@ipe.fzk.de> wrote:
>
>
>  Hello list,
>
> I have a strange problem with a Axis2 service and the corresponding client
> and maybe somebody
> can help me understanding what I'm doing wrong.
>
> I have a status service implemented with Axis2C running under a tomcat and
> the corresponding Java
> client for accessing the service. The java client is called every ten
> seconds from a thread and I can
> access the service without any problems.
>
> The problem is when the thread is running for some hours - normally between
> two or four I got a AxisFault
> with the message: Too many open files. First I thought that the service is
> implemented wrong, but this isn't
> the problem. I monitored the client and there I saw that on the client side
> the number of open files increases.
>
> The thread is implemented as follows:
> //instantiate the stub for the service
> statusStub = new Stub(..);
>
> after that I query the service every ten seconds until a boolean is set to
> false from outside
> while (!bStopThread) {
>    resp = statusStub.getStatus();
>    staResp = resp.get_return();
>    Thread.currentThread().sleep(lStatusQueryTime);
> }
>
> When I do this I can monitor that the number of open files increases and so
> I get the AxisFault
> after some hours of runtime.
>
> Have I done something wrong in my code? Have I to release some objects or to
> instantiate the stub
> for every request? I don't understand whats my error.
>
> Kind regards
> Michael
>
>
>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Re: Periodic query of client

Posted by Michael Sutter <Mi...@ipe.fzk.de>.
Hello Keith,

thanks for your hint. It seems that the reuse solves my problems.
Also thanks for the link, by searching I found nothing which seems
to solve my problem, but the link is very useful for my development .

Kind regards
Michael

keith chapman wrote:
> Hi Michael,
>
> I think I gave you a reply on a different thread. But as you have
> specified your client code here its more clearer to me now. In this
> scenario it might help if you set the following property [1],
>
> stub._getServiceClient().getOptions.setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
> true);
>
> Thanks,
> Keith.
>
> [1] http://wso2.org/library/230#REUSE_HTTP_CLIENT
>
> On Thu, Aug 28, 2008 at 10:23 PM, Michael Sutter
> <Mi...@ipe.fzk.de> wrote:
>   
>> Hello list,
>>
>> I have a strange problem with a Axis2 service and the corresponding client
>> and maybe somebody
>> can help me understanding what I'm doing wrong.
>>
>> I have a status service implemented with Axis2C running under a tomcat and
>> the corresponding Java
>> client for accessing the service. The java client is called every ten
>> seconds from a thread and I can
>> access the service without any problems.
>>
>> The problem is when the thread is running for some hours - normally between
>> two or four I got a AxisFault
>> with the message: Too many open files. First I thought that the service is
>> implemented wrong, but this isn't
>> the problem. I monitored the client and there I saw that on the client side
>> the number of open files increases.
>>
>> The thread is implemented as follows:
>> //instantiate the stub for the service
>> statusStub = new Stub(..);
>>
>> after that I query the service every ten seconds until a boolean is set to
>> false from outside
>> while (!bStopThread) {
>>    resp = statusStub.getStatus();
>>    staResp = resp.get_return();
>>    Thread.currentThread().sleep(lStatusQueryTime);
>> }
>>
>> When I do this I can monitor that the number of open files increases and so
>> I get the AxisFault
>> after some hours of runtime.
>>
>> Have I done something wrong in my code? Have I to release some objects or to
>> instantiate the stub
>> for every request? I don't understand whats my error.
>>
>> Kind regards
>> Michael
>>
>>     
>
>
>
>   

Re: Periodic query of client

Posted by keith chapman <ke...@gmail.com>.
Hi Michael,

I think I gave you a reply on a different thread. But as you have
specified your client code here its more clearer to me now. In this
scenario it might help if you set the following property [1],

stub._getServiceClient().getOptions.setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
true);

Thanks,
Keith.

[1] http://wso2.org/library/230#REUSE_HTTP_CLIENT

On Thu, Aug 28, 2008 at 10:23 PM, Michael Sutter
<Mi...@ipe.fzk.de> wrote:
> Hello list,
>
> I have a strange problem with a Axis2 service and the corresponding client
> and maybe somebody
> can help me understanding what I'm doing wrong.
>
> I have a status service implemented with Axis2C running under a tomcat and
> the corresponding Java
> client for accessing the service. The java client is called every ten
> seconds from a thread and I can
> access the service without any problems.
>
> The problem is when the thread is running for some hours - normally between
> two or four I got a AxisFault
> with the message: Too many open files. First I thought that the service is
> implemented wrong, but this isn't
> the problem. I monitored the client and there I saw that on the client side
> the number of open files increases.
>
> The thread is implemented as follows:
> //instantiate the stub for the service
> statusStub = new Stub(..);
>
> after that I query the service every ten seconds until a boolean is set to
> false from outside
> while (!bStopThread) {
>    resp = statusStub.getStatus();
>    staResp = resp.get_return();
>    Thread.currentThread().sleep(lStatusQueryTime);
> }
>
> When I do this I can monitor that the number of open files increases and so
> I get the AxisFault
> after some hours of runtime.
>
> Have I done something wrong in my code? Have I to release some objects or to
> instantiate the stub
> for every request? I don't understand whats my error.
>
> Kind regards
> Michael
>



-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org