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 gerhard presser <gp...@groiss.com> on 2010/06/22 13:05:24 UTC

reusing configurationcontext objects

hi all,
can a configurationcontext object been reused safely?

I'm having trouble when creating a new configurationcontext object on each
request because of a permgen-space overflow (each configurationcontext
creates it's own axisconfiguration with it's own classloaders) and a
disk-overflow (tmp-files aren't deleted any more)

on the other hand I get a NPE when reusing the configurationcontext with
following serviceclient constructor

public ServiceClient(ConfigurationContext configContext, Definition
wsdl4jDefinition,
                         QName wsdlServiceName, String portName);

any good advice?
regards
 gerhard

-- 
View this message in context: http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28958768.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: reusing configurationcontext objects

Posted by rahul yadav <ra...@gmail.com>.
reuse them

On Tue, Jun 22, 2010 at 4:51 PM, gerhard presser <gp...@groiss.com>wrote:

>
> I don't have any problems concerning the http-connnections!
> what's the recommended way for using configurationcontext-objects?
> 1) use them once per request
> 2) reuse them
>
> regards
>
>
> rahulYadav wrote:
> >
> > try setting this...
> >
> >
> >
> configurationContext.setProperty(Packages.org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
> > true);
> >
> >
> > gerpres wrote:
> >>
> >> FYI: I'm using axis 1.5.1
> >>
> >> I cannot confirm the problem mentioned at:
> >>
> http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-td26442083.html
> >> Reusing ConfigurationContext - Memory leak
> >>
> >>
> >> gerpres wrote:
> >>>
> >>> hi all,
> >>> can a configurationcontext object been reused safely?
> >>>
> >>> I'm having trouble when creating a new configurationcontext object on
> >>> each request because of a permgen-space overflow (each
> >>> configurationcontext creates it's own axisconfiguration with it's own
> >>> classloaders) and a disk-overflow (tmp-files aren't deleted any more)
> >>>
> >>> on the other hand I get a NPE when reusing the configurationcontext
> with
> >>> following serviceclient constructor
> >>>
> >>> public ServiceClient(ConfigurationContext configContext, Definition
> >>> wsdl4jDefinition,
> >>>                          QName wsdlServiceName, String portName);
> >>>
> >>> any good advice?
> >>> regards
> >>>  gerhard
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28958896.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

Re: reusing configurationcontext objects

Posted by gerhard presser <gp...@groiss.com>.
I don't have any problems concerning the http-connnections!
what's the recommended way for using configurationcontext-objects?
1) use them once per request
2) reuse them

regards


rahulYadav wrote:
> 
> try setting this...
> 
> 
> configurationContext.setProperty(Packages.org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
> true); 
> 
> 
> gerpres wrote:
>> 
>> FYI: I'm using axis 1.5.1
>> 
>> I cannot confirm the problem mentioned at: 
>> http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-td26442083.html
>> Reusing ConfigurationContext - Memory leak 
>> 
>> 
>> gerpres wrote:
>>> 
>>> hi all,
>>> can a configurationcontext object been reused safely?
>>> 
>>> I'm having trouble when creating a new configurationcontext object on
>>> each request because of a permgen-space overflow (each
>>> configurationcontext creates it's own axisconfiguration with it's own
>>> classloaders) and a disk-overflow (tmp-files aren't deleted any more)
>>> 
>>> on the other hand I get a NPE when reusing the configurationcontext with
>>> following serviceclient constructor
>>> 
>>> public ServiceClient(ConfigurationContext configContext, Definition
>>> wsdl4jDefinition,
>>>                          QName wsdlServiceName, String portName);
>>> 
>>> any good advice?
>>> regards
>>>  gerhard
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28958896.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: reusing configurationcontext objects

Posted by rahulYadav <ra...@gmail.com>.
try setting this...


configurationContext.setProperty(Packages.org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
true); 


gerpres wrote:
> 
> FYI: I'm using axis 1.5.1
> 
> I cannot confirm the problem mentioned at: 
> http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-td26442083.html
> Reusing ConfigurationContext - Memory leak 
> 
> 
> gerpres wrote:
>> 
>> hi all,
>> can a configurationcontext object been reused safely?
>> 
>> I'm having trouble when creating a new configurationcontext object on
>> each request because of a permgen-space overflow (each
>> configurationcontext creates it's own axisconfiguration with it's own
>> classloaders) and a disk-overflow (tmp-files aren't deleted any more)
>> 
>> on the other hand I get a NPE when reusing the configurationcontext with
>> following serviceclient constructor
>> 
>> public ServiceClient(ConfigurationContext configContext, Definition
>> wsdl4jDefinition,
>>                          QName wsdlServiceName, String portName);
>> 
>> any good advice?
>> regards
>>  gerhard
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28958844.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: reusing configurationcontext objects

Posted by gerhard presser <gp...@groiss.com>.
FYI: I'm using axis 1.5.1

I cannot confirm the problem mentioned at: 
http://old.nabble.com/Resuse-of-configurationcontext-ends-in-out-of-memory-error-td26442083.html
Reusing ConfigurationContext - Memory leak 


gerpres wrote:
> 
> hi all,
> can a configurationcontext object been reused safely?
> 
> I'm having trouble when creating a new configurationcontext object on each
> request because of a permgen-space overflow (each configurationcontext
> creates it's own axisconfiguration with it's own classloaders) and a
> disk-overflow (tmp-files aren't deleted any more)
> 
> on the other hand I get a NPE when reusing the configurationcontext with
> following serviceclient constructor
> 
> public ServiceClient(ConfigurationContext configContext, Definition
> wsdl4jDefinition,
>                          QName wsdlServiceName, String portName);
> 
> any good advice?
> regards
>  gerhard
> 
> 

-- 
View this message in context: http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28958796.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: reusing configurationcontext objects

Posted by gerhard presser <gp...@groiss.com>.
I did some further code research and in my opinion it's absolutely legal to
reuse configurationcontext objects because by default the server's
ListenerManager.defaultConfigurationContext object will be used too.
so this brings me to the point, that using 'non-anonymous'-services (build
dynamically from wsdl) doesn't work properly!!! the services are referenced
by name and therefore must the name must be unique.

am I seeing something wrong?
regards


gerpres wrote:
> 
> hi all,
> can a configurationcontext object been reused safely?
> 
> I'm having trouble when creating a new configurationcontext object on each
> request because of a permgen-space overflow (each configurationcontext
> creates it's own axisconfiguration with it's own classloaders) and a
> disk-overflow (tmp-files aren't deleted any more)
> 
> on the other hand I get a NPE when reusing the configurationcontext with
> following serviceclient constructor
> 
> public ServiceClient(ConfigurationContext configContext, Definition
> wsdl4jDefinition,
>                          QName wsdlServiceName, String portName);
> 
> any good advice?
> regards
>  gerhard
> 
> 

-- 
View this message in context: http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28960113.html
Sent from the Axis - User mailing list archive at Nabble.com.


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


Re: reusing configurationcontext objects

Posted by Kostis Anagnostopoulos <an...@gmail.com>.
Hi Gerhard,

Do you invoke the
  org.apache.axis2.client.Stub.cleanup()
method after having finished with the stub??
This method removes the stub from its service-context.

This thread might be relevant.
http://marc.info/?l=axis-user&m=122213400714608&w=2

(DISCLAIMER: I have no internal knowledge of axis2)

Regards,
  Kostis

On Tue, Jun 22, 2010 at 2:05 PM, gerhard presser <gp...@groiss.com> wrote:
>
> hi all,
> can a configurationcontext object been reused safely?
>
> I'm having trouble when creating a new configurationcontext object on each
> request because of a permgen-space overflow (each configurationcontext
> creates it's own axisconfiguration with it's own classloaders) and a
> disk-overflow (tmp-files aren't deleted any more)
>
> on the other hand I get a NPE when reusing the configurationcontext with
> following serviceclient constructor
>
> public ServiceClient(ConfigurationContext configContext, Definition
> wsdl4jDefinition,
>                         QName wsdlServiceName, String portName);
>
> any good advice?
> regards
>  gerhard
>
> --
> View this message in context: http://old.nabble.com/reusing-configurationcontext-objects-tp28958768p28958768.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

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