You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by mast <ma...@tyranz.com> on 2007/02/12 23:23:35 UTC

tomcat crash with application when doesn't found file

HI, today i have test an application, and i have put a wrong path for the 
file i would like to read, but the thing that surprise me is that it crash 
the tomcat server.
The only things in log is :
(Location of error unknown)java.io.FileNotFoundException: /home/myfile (No 
such file or directory)

Well, after many try my appli crash the server each time i call it with a 
wrong path, i don t think this very normal and i would like to know if there 
is a way to protect the server against bad application like that ?

The problem of a file not found can happen many times and if the server 
crash every time that s a real problem
thanks for your advice 


---------------------------------------------------------------------
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: tomcat crash with application when doesn't found file

Posted by ma...@tyranz.com.
Well of course but when you have many people using the server, such
problem could be very bad , as an admin of the server you can't just
verify each one code and can only touch the server :)
> If your code is badly constructed you can cause the server to fail to
> start properly.  Fix your code, not the server.
>
>
>
>>> whereabouts, in the init method?
>>>
>>> can you post the servlet code?
>>>
>>> have you properly enclosed it in a try { ... } catch(IOException ioe)
>>> {}?
>>>
>>> it sounds like your code is causing the servlet to stop tomcat starting
>>> up by throwing an uncaught exception.
>>>
>>>
>>> p
>>>
>>>
>>>
>>> master@tyranz.com wrote:
>>>> the line of the code is in a servlet i call mysite.com/myservlet
>>>>
>>>> (but i don t have the exact line on me ) i will search it
>>>>>> the code i use is :
>>>>>> Source myfiletxt = new StreamSource(new
>>>>>> File("/home/mast/myfile.txt"));
>>>>> And where is this line of code, in a servlet, a listener, where?
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>



---------------------------------------------------------------------
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: tomcat crash with application when doesn't found file

Posted by Pid <p...@pidster.com>.
master@tyranz.com wrote:
> Yes but my question is why a simple servlet can cause the server to stop ?
> is there a way to protect the tomcat server ?
> i know i probably make a mistake in the code but it shouldn t affect the
> server like that.

If your code is badly constructed you can cause the server to fail to 
start properly.  Fix your code, not the server.



>> whereabouts, in the init method?
>>
>> can you post the servlet code?
>>
>> have you properly enclosed it in a try { ... } catch(IOException ioe) {}?
>>
>> it sounds like your code is causing the servlet to stop tomcat starting
>> up by throwing an uncaught exception.
>>
>>
>> p
>>
>>
>>
>> master@tyranz.com wrote:
>>> the line of the code is in a servlet i call mysite.com/myservlet
>>>
>>> (but i don t have the exact line on me ) i will search it
>>>>> the code i use is :
>>>>> Source myfiletxt = new StreamSource(new
>>>>> File("/home/mast/myfile.txt"));
>>>> And where is this line of code, in a servlet, a listener, where?
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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: tomcat crash with application when doesn't found file

Posted by ma...@tyranz.com.
Yes but my question is why a simple servlet can cause the server to stop ?
is there a way to protect the tomcat server ?
i know i probably make a mistake in the code but it shouldn t affect the
server like that.

> whereabouts, in the init method?
>
> can you post the servlet code?
>
> have you properly enclosed it in a try { ... } catch(IOException ioe) {}?
>
> it sounds like your code is causing the servlet to stop tomcat starting
> up by throwing an uncaught exception.
>
>
> p
>
>
>
> master@tyranz.com wrote:
>> the line of the code is in a servlet i call mysite.com/myservlet
>>
>> (but i don t have the exact line on me ) i will search it
>>>> the code i use is :
>>>> Source myfiletxt = new StreamSource(new
>>>> File("/home/mast/myfile.txt"));
>>> And where is this line of code, in a servlet, a listener, where?
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>



---------------------------------------------------------------------
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: tomcat crash with application when doesn't found file

Posted by Pid <p...@pidster.com>.
whereabouts, in the init method?

can you post the servlet code?

have you properly enclosed it in a try { ... } catch(IOException ioe) {}?

it sounds like your code is causing the servlet to stop tomcat starting 
up by throwing an uncaught exception.


p



master@tyranz.com wrote:
> the line of the code is in a servlet i call mysite.com/myservlet
> 
> (but i don t have the exact line on me ) i will search it
>>> the code i use is :
>>> Source myfiletxt = new StreamSource(new File("/home/mast/myfile.txt"));
>> And where is this line of code, in a servlet, a listener, where?
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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: tomcat crash with application when doesn't found file

Posted by ma...@tyranz.com.
the line of the code is in a servlet i call mysite.com/myservlet

(but i don t have the exact line on me ) i will search it
>> the code i use is :
>> Source myfiletxt = new StreamSource(new File("/home/mast/myfile.txt"));
>
> And where is this line of code, in a servlet, a listener, where?
>



---------------------------------------------------------------------
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: tomcat crash with application when doesn't found file

Posted by Pid <p...@pidster.com>.
master@tyranz.com wrote:
> When i mean crash the server it s simply that the tomcat server stop,
> after the message file not found, the tomcat server simply stop (when i do
> a ps it isn't there anymore)
> 
> the code i use is :
> Source myfiletxt = new StreamSource(new File("/home/mast/myfile.txt"));

And where is this line of code, in a servlet, a listener, where?

> whell the "/home/mast/myfile.txt" was an incorrect path and that s this
> thing that make crash the tomcat server.
> 
>> perhaps you could define in more detail what you mean by "crash the
>> server"?
>>
>> do you mean that it shows an error page?
>> or do you mean that it terminates the server?
>> in which piece of code are you requesting the non-existent file?
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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: tomcat crash with application when doesn't found file

Posted by ma...@tyranz.com.
When i mean crash the server it s simply that the tomcat server stop,
after the message file not found, the tomcat server simply stop (when i do
a ps it isn't there anymore)

the code i use is :
Source myfiletxt = new StreamSource(new File("/home/mast/myfile.txt"));

whell the "/home/mast/myfile.txt" was an incorrect path and that s this
thing that make crash the tomcat server.

> perhaps you could define in more detail what you mean by "crash the
> server"?
>
> do you mean that it shows an error page?
> or do you mean that it terminates the server?
> in which piece of code are you requesting the non-existent file?
>



---------------------------------------------------------------------
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: tomcat crash with application when doesn't found file

Posted by Pid <p...@pidster.com>.
perhaps you could define in more detail what you mean by "crash the server"?

do you mean that it shows an error page?
or do you mean that it terminates the server?
in which piece of code are you requesting the non-existent file?



p



mast wrote:
> But it s a recent version tomcat 5.5.20 and i have install it not much 
> time ago, the message i copy you was from the catalina.out.
> 
> 
> ----- Original Message ----- From: "Stefan" <st...@telig.de>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Monday, February 12, 2007 11:43 PM
> Subject: Re: tomcat crash with application when doesn't found file
> 
> 
>> mast schrieb:
>>> HI, today i have test an application, and i have put a wrong path for 
>>> the file i would like to read, but the thing that surprise me is that 
>>> it crash the tomcat server.
>>> The only things in log is :
>>> (Location of error unknown)java.io.FileNotFoundException: 
>>> /home/myfile (No such file or directory)
>>>
>>> Well, after many try my appli crash the server each time i call it 
>>> with a wrong path, i don t think this very normal and i would like to 
>>> know if there is a way to protect the server against bad application 
>>> like that ?
>>>
>>> The problem of a file not found can happen many times and if the 
>>> server crash every time that s a real problem
>>> thanks for your advice
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>>
>>>
>> Try again with a new, clean installation of a recent tomcat version. 
>> Requesting unknown resources should result in a error message (return 
>> a status code)
>>
>> Status report
>> message /the/wrong/path
>> description The requested resource (/the/wrong/path) is not available.
>>
>> -- 
>> Stefan
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 


---------------------------------------------------------------------
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: tomcat crash with application when doesn't found file

Posted by mast <ma...@tyranz.com>.
But it s a recent version tomcat 5.5.20 and i have install it not much time 
ago, the message i copy you was from the catalina.out.


----- Original Message ----- 
From: "Stefan" <st...@telig.de>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Monday, February 12, 2007 11:43 PM
Subject: Re: tomcat crash with application when doesn't found file


> mast schrieb:
>> HI, today i have test an application, and i have put a wrong path for the 
>> file i would like to read, but the thing that surprise me is that it 
>> crash the tomcat server.
>> The only things in log is :
>> (Location of error unknown)java.io.FileNotFoundException: /home/myfile 
>> (No such file or directory)
>>
>> Well, after many try my appli crash the server each time i call it with a 
>> wrong path, i don t think this very normal and i would like to know if 
>> there is a way to protect the server against bad application like that ?
>>
>> The problem of a file not found can happen many times and if the server 
>> crash every time that s a real problem
>> thanks for your advice
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
> Try again with a new, clean installation of a recent tomcat version. 
> Requesting unknown resources should result in a error message (return a 
> status code)
>
> Status report
> message /the/wrong/path
> description The requested resource (/the/wrong/path) is not available.
>
> -- 
> Stefan
>
>
> ---------------------------------------------------------------------
> 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: tomcat crash with application when doesn't found file

Posted by Stefan <st...@telig.de>.
mast schrieb:
> HI, today i have test an application, and i have put a wrong path for 
> the file i would like to read, but the thing that surprise me is that 
> it crash the tomcat server.
> The only things in log is :
> (Location of error unknown)java.io.FileNotFoundException: /home/myfile 
> (No such file or directory)
>
> Well, after many try my appli crash the server each time i call it 
> with a wrong path, i don t think this very normal and i would like to 
> know if there is a way to protect the server against bad application 
> like that ?
>
> The problem of a file not found can happen many times and if the 
> server crash every time that s a real problem
> thanks for your advice
>
> ---------------------------------------------------------------------
> 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
>
>
Try again with a new, clean installation of a recent tomcat version. 
Requesting unknown resources should result in a error message (return a 
status code)

Status report
message /the/wrong/path
description The requested resource (/the/wrong/path) is not available.

-- 
Stefan


---------------------------------------------------------------------
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