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 Jason Wells <ja...@wells.me> on 2009/01/27 20:57:16 UTC

Lifecycle, ServiceLifeCycle methods never called?

Hi,

I have an Axis2 1.4.1 service in Tomcat 6 deployed at transport  
session scope. It implements Lifecycle and ServiceLifeCycle. When I  
hit the service for the first time, I can see init() gets called.  
However, neither startUp(), shutDown() nor destroy() ever get called,  
not even when I let the session time out or shut down Tomcat. What am  
I missing?

Thanks,
Jason


Re: Lifecycle, ServiceLifeCycle methods never called?

Posted by Jason Wells <ja...@wells.me>.
Amila,

Thank you, that did the trick. For the destroy() problem, I'm getting  
inconsistent behavior: sometimes it gets fired, sometimes not. It  
seems that Tomcat has to be running for a minimum of 5-6 minutes in  
order for it to be called most often, although that isn't reliably true.

Jason


On Jan 27, 2009, at 9:54 PM, Amila Suriarachchi wrote:

>
>
> On Wed, Jan 28, 2009 at 1:27 AM, Jason Wells <ja...@wells.me> wrote:
> Hi,
>
> I have an Axis2 1.4.1 service in Tomcat 6 deployed at transport  
> session scope. It implements Lifecycle and ServiceLifeCycle. When I  
> hit the service for the first time, I can see init() gets called.  
> However, neither startUp(), shutDown() nor destroy() ever get  
> called, not even when I let the session time out or shut down  
> Tomcat. What am I missing?
>
> you need to set ServiceLifeCycle as follows
>
> <service name="POJOService"  
> class="test.kp.service.TestServiceLifeCycle">
>
> in the services.xml
>
> ServiceLifeCycle actually refers to AxisService Object life cycle.
>
> thanks,
> Amila.
>
> Thanks,
> Jason
>
>
>
>
> -- 
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/


Re: Lifecycle, ServiceLifeCycle methods never called?

Posted by Amila Suriarachchi <am...@gmail.com>.
have a look at here[1]

thanks,
Amila.

[1] http://blog.facilelogin.com/2008/11/axis2-services-lifecycle-vs.html

On Wed, Jan 28, 2009 at 11:24 AM, Amila Suriarachchi <
amilasuriarachchi@gmail.com> wrote:

>
>
> On Wed, Jan 28, 2009 at 1:27 AM, Jason Wells <ja...@wells.me> wrote:
>
>> Hi,
>> I have an Axis2 1.4.1 service in Tomcat 6 deployed at transport session
>> scope. It implements Lifecycle and ServiceLifeCycle. When I hit the
>> service for the first time, I can see init() gets called. However, neither
>> startUp(), shutDown() nor destroy() ever get called, not even when I let the
>> session time out or shut down Tomcat. What am I missing?
>>
>
> you need to set ServiceLifeCycle as follows
>
> <service name="POJOService" class="test.kp.service.TestServiceLifeCycle">
>
> in the services.xml
>
> ServiceLifeCycle actually refers to AxisService Object life cycle.
>
> thanks,
> Amila.
>
>>
>> Thanks,
>> Jason
>>
>>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: Lifecycle, ServiceLifeCycle methods never called?

Posted by Amila Suriarachchi <am...@gmail.com>.
On Wed, Jan 28, 2009 at 1:27 AM, Jason Wells <ja...@wells.me> wrote:

> Hi,
> I have an Axis2 1.4.1 service in Tomcat 6 deployed at transport session
> scope. It implements Lifecycle and ServiceLifeCycle. When I hit the
> service for the first time, I can see init() gets called. However, neither
> startUp(), shutDown() nor destroy() ever get called, not even when I let the
> session time out or shut down Tomcat. What am I missing?
>

you need to set ServiceLifeCycle as follows

<service name="POJOService" class="test.kp.service.TestServiceLifeCycle">

in the services.xml

ServiceLifeCycle actually refers to AxisService Object life cycle.

thanks,
Amila.

>
> Thanks,
> Jason
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/