"Johnny Kewl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ok... beginning to think I'm the only one reading here... yes it is a > kludge, and I doubt very much whether changing anything in catalina.policy > will do anything in this case... because the security manager is probably > incorporated in the web-app class loader... and yes this and the > documentation makes sense when protecting Tomcat from a rouge web-app.... > but thats not what I'm trying to do... I'm trying to protect an embedded > application FROM TOMCAT itself. > The code I have shown you is TOMCATS CODE... not the embedded application > code which is using tomcat as a library... or a Web-App's code. > > Ok... think we got crossed lines somewhere... but just to recap... Tomcats > System.Exit code kills the client calling tomcat... its rude ;) > I suppose I could write a class loader in the client... tell it to stop > System.Exits in a custom security manager... and then load up tomcat using > that classloader... little bit too much work dont you think? > All I think is happening is that those System.Exits make a lot of sense > from a server perspective... but not from an embedded perspective... its > not a disaster, it doenst make tomcat bad (its great), its just something > to think about.... >
What this does is to make certain that Tomcat dies in the event that the shutdown Socket connection dies (rarely happens). A properly designed Embedded TC shouldn't have to go through this code: It should have it's own mechanism for signaling shutting down, and call the 'stop' method on the Catalina/Embedded/Server instance (via JMX or otherwise). Since the 'stopServer' method is intended for a stand-alone TC, I'm going to guess that you won't get much developer interest in removing the System.exit calls. > > ----- Original Message ----- > From: "Pid" <[EMAIL PROTECTED]> > To: "Tomcat Users List" <users@tomcat.apache.org> > Sent: Thursday, May 24, 2007 8:04 PM > Subject: Re: TOMCAT ISSUE: System.Exit > > >> Johnny Kewl wrote: >>> Ha ha... I think this is a kludge, >> >> Using a SecurityManager is a kludge? >> >> but ok, I have "read"... so help >>> me... I want to stop Tomcat calling System.Exit(1)... what do I need to >>> do to the catalina.policy file to do this? >>> I imagine that instead of the embedded app shutting down the user will >>> now get a security exception, which to me is wrong... but hey, I'll try >>> it. >> >> The 'System.exit()' example is the usual one, as you will remember from >> when you read the documentation: >> >> http://tomcat.apache.org/tomcat-5.0-doc/security-manager-howto.html >> >> p >> >> >>> ----- Original Message ----- From: "Peter Crowther" >>> <[EMAIL PROTECTED]> >>> To: "Tomcat Users List" <users@tomcat.apache.org> >>> Sent: Thursday, May 24, 2007 6:21 PM >>> Subject: RE: TOMCAT ISSUE: System.Exit >>> >>> >>>> From: Johnny Kewl [mailto:[EMAIL PROTECTED] >>>> Imagine I make a library for you... and your user application >>>> does something >>>> wrong... and then my library calls System.Exit and shuts down >>>> the JVM... how >>>> you going to fix that with a security manager?? >>> >>> The security manager can prevent the call from succeeding. Read, don't >>> just assume it can't work. >>> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#exit(int) >>> will give you hint on the fact that exit can be prevented by a security >>> manager, for example. >>> >>> - Peter >>> >>> --------------------------------------------------------------------- >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >>> --------------------------------------------------------------------- >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]