You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yaar Schnitman <ya...@pando.com> on 2006/11/02 23:24:11 UTC

Could a bad servlet initializtion stop tomcat?

Is there a way to make the failure of a single servlet's initialization 
stop the initialization of the other servlets, or even stop tomcat with 
an error?

The issue is that my system operators fail to notice initialization errors.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Could a bad servlet initializtion stop tomcat?

Posted by Martin Gainty <mg...@hotmail.com>.
you're definitely targetting the most resource intensive and tangential use case 
Although there seems to be a bit of a disconnect that where exception logic shuts-down the server its running on
BTW putting a system.exit(0) in your catch block will shutdown tomcat as well... albeit not gracefully!
If you want to look at various enterprise level development scenarios using design patterns such as Session-Facade or MVC feel free to ping this list

GL,
M-
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "Joseph Ray" <jr...@FreshWaterPublishing.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Friday, November 03, 2006 9:56 AM
Subject: RE: Could a bad servlet initializtion stop tomcat?


Thanks for the input.  Something I forgot to mention.  My CTO built a
custom App in java.  That's why we need tomcat.  I believe he did all
his programming, and testing on a Mac.  I believe your input was more
valuable than you first realized.  

Thanks for the Help,

 

Joseph Ray

Network Administrator

Freshwater Publishing

269-704-8113


-----Original Message-----
From: Edoardo Panfili [mailto:edoardo@aspix.it] 
Sent: Friday, November 03, 2006 9:50 AM
To: Tomcat Users List
Subject: Re: Could a bad servlet initializtion stop tomcat?

Yaar Schnitman ha scritto:
> Is there a way to make the failure of a single servlet's
initialization 
> stop the initialization of the other servlets, or even stop tomcat
with 
> an error?
> 
I can't reproduce always the error but some time ago I had a servlet 
that builds a bitmap (Mac OS X, Tomcat 5.0.x), sometimes the whole 
server crashes. I think that the error was (or is, I don't know) in the
VM.

The only solution that I was able to find is to produce svg graphics 
(obviously not a solution).


Edoardo
-- 
edoardo@aspix.it
AIM: edoardopn
Jabber: edoardopa@talk.google.com
tel:075 9142766

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Could a bad servlet initializtion stop tomcat?

Posted by Joseph Ray <jr...@FreshWaterPublishing.com>.
Thanks for the input.  Something I forgot to mention.  My CTO built a
custom App in java.  That's why we need tomcat.  I believe he did all
his programming, and testing on a Mac.  I believe your input was more
valuable than you first realized.  

Thanks for the Help,

 

Joseph Ray

Network Administrator

Freshwater Publishing

269-704-8113


-----Original Message-----
From: Edoardo Panfili [mailto:edoardo@aspix.it] 
Sent: Friday, November 03, 2006 9:50 AM
To: Tomcat Users List
Subject: Re: Could a bad servlet initializtion stop tomcat?

Yaar Schnitman ha scritto:
> Is there a way to make the failure of a single servlet's
initialization 
> stop the initialization of the other servlets, or even stop tomcat
with 
> an error?
> 
I can't reproduce always the error but some time ago I had a servlet 
that builds a bitmap (Mac OS X, Tomcat 5.0.x), sometimes the whole 
server crashes. I think that the error was (or is, I don't know) in the
VM.

The only solution that I was able to find is to produce svg graphics 
(obviously not a solution).


Edoardo
-- 
edoardo@aspix.it
AIM: edoardopn
Jabber: edoardopa@talk.google.com
tel:075 9142766

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Could a bad servlet initializtion stop tomcat?

Posted by Edoardo Panfili <ed...@aspix.it>.
Yaar Schnitman ha scritto:
> Is there a way to make the failure of a single servlet's initialization 
> stop the initialization of the other servlets, or even stop tomcat with 
> an error?
> 
I can't reproduce always the error but some time ago I had a servlet 
that builds a bitmap (Mac OS X, Tomcat 5.0.x), sometimes the whole 
server crashes. I think that the error was (or is, I don't know) in the VM.

The only solution that I was able to find is to produce svg graphics 
(obviously not a solution).


Edoardo
-- 
edoardo@aspix.it
AIM: edoardopn
Jabber: edoardopa@talk.google.com
tel:075 9142766

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Could a bad servlet initializtion stop tomcat?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Martin,

Martin Gainty wrote:
> Yaar-
> try 
> 
> init()
> {
>  try 
> {
> //code here
> }
> catch(Exception excp)
> {
> System.exec("/PATH/TO/JAKARTA/bin/shutdown.sh");
> }
> }

OMG I'm going to vomit. At least you could have used System.exit().

Please, everyone, never do anything like this.

-chris



Re: Could a bad servlet initializtion stop tomcat?

Posted by Martin Gainty <mg...@hotmail.com>.
Yaar-
try 

init()
{
 try 
{
//code here
}
catch(Exception excp)
{
System.exec("/PATH/TO/JAKARTA/bin/shutdown.sh");
}
}

Anyone else?
Martin --
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "Yaar Schnitman" <ya...@pando.com>
To: <us...@tomcat.apache.org>
Sent: Thursday, November 02, 2006 5:24 PM
Subject: Could a bad servlet initializtion stop tomcat?


> Is there a way to make the failure of a single servlet's initialization 
> stop the initialization of the other servlets, or even stop tomcat with 
> an error?
> 
> The issue is that my system operators fail to notice initialization errors.
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>

Re: Could a bad servlet initializtion stop tomcat?

Posted by Tim Funk <fu...@joedog.org>.
It may be better to move the "startup code" to a ServletContextListener. 
When a ServletContextLister fails on startup - then the webapp is 
unavailable.

When the webapp is unavailable - any HTTP based monitoring tool would 
pick that up (due the error page returned)

-Tim

Yaar Schnitman wrote:
> Is there a way to make the failure of a single servlet's initialization 
> stop the initialization of the other servlets, or even stop tomcat with 
> an error?
> 
> The issue is that my system operators fail to notice initialization errors.
> 

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Could a bad servlet initializtion stop tomcat?

Posted by David Smith <dn...@cornell.edu>.
A lot of things are possible.

 I'm sure a context could fail to start because of bad code. Even seen 
it happen once or twice.

 The whole container? I'll say possible, but the code would have to do 
some really terrible things. I can't see it happening by accident unless 
you call System.exit()

 -David

Yaar Schnitman wrote:
> Is there a way to make the failure of a single servlet's 
> initialization stop the initialization of the other servlets, or even 
> stop tomcat with an error?
>
> The issue is that my system operators fail to notice initialization 
> errors.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


-- 
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org