Re: Trouble with ServerServlet
Thanks Thierry, thought that may be the case. cheers /jima 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=4447dsMessageId=2497869 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2498579
RE: Trouble with ServerServlet
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=4447dsMessageId=2410097 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2412127
Re: Trouble with ServerServlet
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=4447dsMessageId=2410088
Re: Trouble with ServerServlet
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 rickardob...@gmail.com 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=4447dsMessageId=2410088 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2410096
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=4447dsMessageId=2410097