You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Litrik De Roy <co...@litrik.com> on 2003/12/01 19:36:09 UTC

System.exit() brings down Jetty/Cocoon

A call to System.exit(0) (for example in an XSP page) brings down 
Jetty/Cocoon without any warning or error message.

Is Jetty/Cocoon supposed to behave this way?

How can this be prevented?

PS: Yes I know that calling System.exit() is stupid, but our 
Cocoon-based webapp is crashing intermittingly without any trace and I'm 
suspecting that somewhere in one of the 25 third-party jars a 
System.exit() gets called (for whatever reason). Hence my testing, and 
this question.

-- 

Litrik De Roy
www.litrik.com




Re: System.exit() brings down Jetty/Cocoon

Posted by Michael Hartle <mh...@hartle-klug.com>.
Hi Litrik,

> A call to System.exit(0) (for example in an XSP page) brings down 
> Jetty/Cocoon without any warning or error message.
>
> Is Jetty/Cocoon supposed to behave this way?
>
> How can this be prevented?
>
> PS: Yes I know that calling System.exit() is stupid, but our 
> Cocoon-based webapp is crashing intermittingly without any trace and 
> I'm suspecting that somewhere in one of the 25 third-party jars a 
> System.exit() gets called (for whatever reason). Hence my testing, and 
> this question.

I once had the issue that when using a JPEG encoding class contained in 
Suns JDK, an exception in a native class brought the whole VM down 
without any hint given. When hunting down that bug, I found that IBMs 
JDK behaved the same way (crashing), but at least provided a stacktrace 
in a seperate logfile; it might be worth trying just in case it is not a 
System.exit()-call that is taking you down.

Good luck and best regards,

Michael Hartle



Re: System.exit() brings down Jetty/Cocoon

Posted by Tony Collen <co...@umn.edu>.
Litrik De Roy wrote:
> A call to System.exit(0) (for example in an XSP page) brings down 
> Jetty/Cocoon without any warning or error message.
> 
> Is Jetty/Cocoon supposed to behave this way?
> 
> How can this be prevented?

Hm, the only thing I can find is that System.exit() throws a SecurityException if the 
securitymanager won't let it:

http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#exit(int)

implementation is left as an exercise to the reader :)


Tony

> 
> PS: Yes I know that calling System.exit() is stupid, but our 
> Cocoon-based webapp is crashing intermittingly without any trace and I'm 
> suspecting that somewhere in one of the 25 third-party jars a 
> System.exit() gets called (for whatever reason). Hence my testing, and 
> this question.
> 



RE: System.exit() brings down Jetty/Cocoon

Posted by Leo Sutic <le...@inspireinfrastructure.com>.
Litrik,

I have had instances where the JVM has shut down due to a stack
overflow.
No exceptions, errors or anything - the JVM just stopped.

However, if you still suspect a System.exit, I suggest you grab a Java
decompiler
and run it on all the 3rd party jars. Then grep for System.exit. That
should
settle your suspicions.

(I also suspect you can grep for that method name in the .class files - 
but I'm not sure.)

/LS

> From: Litrik De Roy [mailto:cocoon-dev@litrik.com] 
> 
> A call to System.exit(0) (for example in an XSP page) brings down 
> Jetty/Cocoon without any warning or error message.
> 
> Is Jetty/Cocoon supposed to behave this way?
> 
> How can this be prevented?
> 
> PS: Yes I know that calling System.exit() is stupid, but our 
> Cocoon-based webapp is crashing intermittingly without any 
> trace and I'm 
> suspecting that somewhere in one of the 25 third-party jars a 
> System.exit() gets called (for whatever reason). Hence my 
> testing, and 
> this question.
> 
> -- 
> 
> Litrik De Roy
> www.litrik.com
> 
> 
> 
> 
>