Re: Trouble with ServerServlet

2010-04-06 Thread Jim Alateras
Thanks Thierry, thought that may be the case.

cheers




On 06/04/2010, at 8:05 PM, Thierry Boileau wrote:

> Hello Jim,
>
> this is a good question. Actually, we were quite reluctant to update  
> the 1.1 branch, since it can modify the behaviour of existing  
> applications. Thus, the 1.1 branch has not been updated.
> However, you can still inherit from the ServerServlet class, and  
> override the "destroy" method.
>
> Best regards,
> Thierry Boileau
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2497869

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2498579


RE: Fwd: Trouble with ServerServlet

2010-04-06 Thread Thierry Boileau
Hello Jim,

this is a good question. Actually, we were quite reluctant to update the 1.1 
branch, since it can modify the behaviour of existing applications. Thus, the 
1.1 branch has not been updated.
However, you can still inherit from the ServerServlet class, and override the 
"destroy" method.

Best regards,
Thierry Boileau

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2497869


Fwd: Trouble with ServerServlet

2010-04-06 Thread Jim Alateras
Jerome,

I was wondering whether this change is on the 1.1.9 branch.  I can see  
that Application.start is called when ServerServlet.init is called but  
cannot see the Application.stop is being called when  
ServerServlet.destroy is called.

cheers




Begin forwarded message:

> From: Jerome Louvel 
> Date: 29 October 2009 1:13:46 AM
> To: discuss@restlet.tigris.org
> Subject: RE: Trouble with ServerServlet
> Reply-To: discuss 
>
> Hi Rickard,
>
> Very good points, the life cycle of Servlet wasn't correctly  
> propagated. In addition, we had a pending issue to propagate these  
> events inside the Restlet routing system (from a component to the  
> contained applications for example).
>
> "Make start/stop usage consistent"
> http://restlet.tigris.org/issues/show_bug.cgi?id=761
>
>
> I have just checked in the required changes in SVN trunk and fixed  
> ServerServlet. Could you try again with the next snapshot?
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
>
> -Message d'origine-
> De : Rickard Öberg [mailto:rickardob...@gmail.com]
> Envoyé : jeudi 22 octobre 2009 09:36
> À : discuss@restlet.tigris.org
> Objet : Re: Trouble with ServerServlet
>
> On 2009-10-22 15.32, Rémi Dewitte wrote:
>> Rickard,
>>
>> I have the feeling that overriding ServerServlet is not the way to  
>> go.
>> AFAIR you should be able to use it out ofthebox configuring the
>> application in web.xml. I don't know if stop() is called either but I
>> think so.
>
> Overriding ServerServlet.destroy is definitely not right, but that's  
> the
> only way I can get it to work. Preferably I should only have to  
> override
> createApplication. But if I do that, then application.stop() is not
> always called, as I get cases where the Component is considered  
> stopped,
> and so application.stop() is not called.
>
> I could very easily reproduce this by simply deploying, and then
> redeploy again immediatly, without any servlet calls having been made.
> The application is instantiated and started, but not stopped on
> destroy(), as the Component is stopped. It seems there's a logic error
> somewhere in the code.
>
> /Rickard
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2410097
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2412127

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2496286


RE: Trouble with ServerServlet

2009-10-28 Thread Jerome Louvel
Hi Rickard,

Very good points, the life cycle of Servlet wasn't correctly propagated. In 
addition, we had a pending issue to propagate these events inside the Restlet 
routing system (from a component to the contained applications for example).

"Make start/stop usage consistent"
http://restlet.tigris.org/issues/show_bug.cgi?id=761


I have just checked in the required changes in SVN trunk and fixed 
ServerServlet. Could you try again with the next snapshot?

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com



-Message d'origine-
De : Rickard Öberg [mailto:rickardob...@gmail.com] 
Envoyé : jeudi 22 octobre 2009 09:36
À : discuss@restlet.tigris.org
Objet : Re: Trouble with ServerServlet

On 2009-10-22 15.32, Rémi Dewitte wrote:
> Rickard,
>
> I have the feeling that overriding ServerServlet is not the way to go.
> AFAIR you should be able to use it out ofthebox configuring the
> application in web.xml. I don't know if stop() is called either but I
> think so.

Overriding ServerServlet.destroy is definitely not right, but that's the 
only way I can get it to work. Preferably I should only have to override 
createApplication. But if I do that, then application.stop() is not 
always called, as I get cases where the Component is considered stopped, 
and so application.stop() is not called.

I could very easily reproduce this by simply deploying, and then 
redeploy again immediatly, without any servlet calls having been made. 
The application is instantiated and started, but not stopped on 
destroy(), as the Component is stopped. It seems there's a logic error 
somewhere in the code.

/Rickard

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2410097

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2412127


Re: Trouble with ServerServlet

2009-10-22 Thread Rickard Öberg
On 2009-10-22 15.32, Rémi Dewitte wrote:
> Rickard,
>
> I have the feeling that overriding ServerServlet is not the way to go.
> AFAIR you should be able to use it out ofthebox configuring the
> application in web.xml. I don't know if stop() is called either but I
> think so.

Overriding ServerServlet.destroy is definitely not right, but that's the 
only way I can get it to work. Preferably I should only have to override 
createApplication. But if I do that, then application.stop() is not 
always called, as I get cases where the Component is considered stopped, 
and so application.stop() is not called.

I could very easily reproduce this by simply deploying, and then 
redeploy again immediatly, without any servlet calls having been made. 
The application is instantiated and started, but not stopped on 
destroy(), as the Component is stopped. It seems there's a logic error 
somewhere in the code.

/Rickard

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2410097


Re: Trouble with ServerServlet

2009-10-22 Thread Rémi Dewitte
Rickard,

I have the feeling that overriding ServerServlet is not the way to go. AFAIR
you should be able to use it out ofthebox configuring the application in
web.xml. I don't know if stop() is called either but I think so.

Rémi

On Thu, Oct 22, 2009 at 08:56, Rickard Öberg  wrote:

> On 2009-10-21 18.24, Rickard Öberg wrote:
> > I can see that ServerServlet.destroy() *is* called when webapp is
> > redeployed, but it doesn't call stop() on my application. When looking
> > in the ServerServlet code it's a bit weird, because the init() code
> > calls getApplication().start(), but destroy() calls
> > getComponent().stop()! I'm guessing my problem is somewhere with that.
> > Why aren't these methods starting/stopping the same thing?
>
> I've temporarily "fixed" this by overriding destroy() as well, and do
> application.stop() on my own. This works, but I'd prefer if the base
> ServerServlet does it for me.
>
> /Rickard
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2410088
>

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2410096

Re: Trouble with ServerServlet

2009-10-21 Thread Rickard Öberg
On 2009-10-21 18.24, Rickard Öberg wrote:
> I can see that ServerServlet.destroy() *is* called when webapp is
> redeployed, but it doesn't call stop() on my application. When looking
> in the ServerServlet code it's a bit weird, because the init() code
> calls getApplication().start(), but destroy() calls
> getComponent().stop()! I'm guessing my problem is somewhere with that.
> Why aren't these methods starting/stopping the same thing?

I've temporarily "fixed" this by overriding destroy() as well, and do 
application.stop() on my own. This works, but I'd prefer if the base 
ServerServlet does it for me.

/Rickard

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2410088


Trouble with ServerServlet

2009-10-21 Thread Rickard Öberg
Hi,

I'm having some trouble with ServerServlet, and am a bit stuck. What 
I've done is to subclass ServerServlet and override the 
createApplication() method to create and return my own subclass of 
Application. Then, in start() I create and initialize my whole internal 
application setup. When the Tomcat container starts upp I can see that 
start() is being called properly. So far so good.

But, when I redeploy the application stop() is not always called on the 
Application (only sometimes!), and so my app is not properly shutdown, 
which then causes problems when the next version is started.

I can see that ServerServlet.destroy() *is* called when webapp is 
redeployed, but it doesn't call stop() on my application. When looking 
in the ServerServlet code it's a bit weird, because the init() code 
calls getApplication().start(), but destroy() calls 
getComponent().stop()! I'm guessing my problem is somewhere with that. 
Why aren't these methods starting/stopping the same thing?

Is there something else I'm missing? Is it a bug in my code or Restlet? 
Should I implement my own Component instead of Application?

thanks, Rickard

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2409718