You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andreas <sa...@hotmail.com> on 2008/04/24 15:21:47 UTC

Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help since i am not able to
find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders so that the end user will b able to download later.
The files I download or I create though, and save in my new folders created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back from the local disk.

So, what should I do to make the newly created folders and files instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

RES: Runtime created files not accessible.SOLUTION FINALLY!!!

Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Here comes NetBeans to 'save' the day... I had a similar problem working
on a Swing project... My non java files kept being excluded all the
time... 

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com] 
Enviada em: sexta-feira, 25 de abril de 2008 07:42
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.SOLUTION FINALLY!!!

ONCE AGAIN THNX TO ALL!

It turned out that NetBeans deployment in Tomcat was destroying
everything!!!!

The solution was to clean and build the project with Netbeans, but
manuall deploy the war file from the Tomcat Manager...

Now everything works as it should...

I just can't believe the frustration and waste of time NetBeans stupuid
deploying mechanisms have caused me...

So to anyone who might have the same situation, be careful...

Take care all and keep up the good work and the healthy supporting IT
community that saves people's lives :)

Best Regards,

Andreas, Greece.

---------------------------------------------------------------------
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: Runtime created files not accessible.SOLUTION FINALLY!!!

Posted by Andreas <sa...@hotmail.com>.
ONCE AGAIN THNX TO ALL!

It turned out that NetBeans deployment in Tomcat was destroying 
everything!!!!

The solution was to clean and build the project with Netbeans, but manuall 
deploy the war file from
the Tomcat Manager...

Now everything works as it should...

I just can't believe the frustration and waste of time NetBeans stupuid 
deploying mechanisms have caused me...

So to anyone who might have the same situation, be careful...

Take care all and keep up the good work and the healthy supporting IT 
community
that saves people's lives :)

Best Regards,

Andreas, Greece.


----- Original Message ----- 
From: "Andreas" <sa...@hotmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Friday, April 25, 2008 10:38 AM
Subject: Re: Runtime created files not accessible.Some progress.


>
> One big thnx to all of you who have shown interest in my situation.
>
> There has been some "progress"...
>
> Marcus, I didnt try your code, since the problem doesnt occur just with 
> java, but also
> if i manually create a new folder/file in windows while the server is up.
> I get same problem.
>
> The other thing I noticed is that, if i create new folder/file in windows 
> environment,
> in the ROOT context path, where there are already applications running on 
> the server,
> then the server DOES SEE THEM.
> for example, there is this path:    C:\Program Files\Apache Software 
> Foundation\Tomcat 6.0\webapps\ROOT
> and i create the folder a and the file b.txt,
> then i can give the url: http://localhost:8080/a/b.txt
> and tomcat DOES OPEN IT!!!
>
> The problem exists with all kind of web applications created with 
> NetBEans!!
> Not particularly JSF, since I also had it with simple JSP...
>
> Any idea what kind of configuration and in which file could cause this 
> thing...???
> Could it be that i dont form the URL properly maybe???
>
> Thank you all very very much.
>
> Andreas.
>
> ---------------------------------------------------------------------
> 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: Runtime created files not accessible.Some progress.

Posted by Andreas <sa...@hotmail.com>.
One big thnx to all of you who have shown interest in my situation.

There has been some "progress"...

Marcus, I didnt try your code, since the problem doesnt occur just with 
java, but also
if i manually create a new folder/file in windows while the server is up.
I get same problem.

The other thing I noticed is that, if i create new folder/file in windows 
environment,
in the ROOT context path, where there are already applications running on 
the server,
then the server DOES SEE THEM.
for example, there is this path:    C:\Program Files\Apache Software 
Foundation\Tomcat 6.0\webapps\ROOT
and i create the folder a and the file b.txt,
then i can give the url: http://localhost:8080/a/b.txt
and tomcat DOES OPEN IT!!!

The problem exists with all kind of web applications created with NetBEans!!
Not particularly JSF, since I also had it with simple JSP...

Any idea what kind of configuration and in which file could cause this 
thing...???
Could it be that i dont form the URL properly maybe???

Thank you all very very much.

Andreas. 


---------------------------------------------------------------------
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: Runtime created files not accessible.Please help.

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Andreas [mailto:sardanapalos928@hotmail.com] 
> Subject: Re: Runtime created files not accessible.Please help.
> 
> By the way, do the newly created files have to be in some 
> place specific for tomcat to "see" them???

Not in particular, as long as the path used to retrieve the files is
known either to the webapp servlets, or is directly referenceable via
the webapp URL.

You might want to install Tomcat in a location that does not includes
spaces in the path - that can lead to a great deal of confusion.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
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: Runtime created files not accessible.Please help.

Posted by Andreas <sa...@hotmail.com>.
By the way, do the newly created files have to be in some place specific for 
tomcat to "see" them???


----- Original Message ----- 
From: "Andreas" <sa...@hotmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 11:05 PM
Subject: Re: Runtime created files not accessible.Please help.


> Hello Marcus, Hello all.
>
> Thank you very for ur help,although i dont seem to get any solution and 
> it's just completely frustrating...
>
> Marcus, when you say regular servlet you mean..?? simple JSP ?
> I am not sure I got it.
>
> Coz I also tested through a simple JSP and I got the same problems...
>
> Best Regards,
>
> Andreas.
>
> ----- Original Message ----- 
> From: "Milanez, Marcus" <Ma...@diebold.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Thursday, April 24, 2008 5:33 PM
> Subject: RES: Runtime created files not accessible.Please help.
>
>
>
> Andreas,
>
> Can you read the created files/folder using a regular servlet? If you
> can do it so, I would advice you to dispatch download requests to this
> servlet, read the requested file and then write it in response.
> Something like this (in your doPost or doGet):
>
> response.setContentType("application/x-msdownload");
>
> String filePath = getServletContext().getRealPath("/") +
> "your-correct-path" + request.getParameter("fileName");
>
> File requestedFile = new File(filePath);
>
> response.addHeader("Content-Disposition", "attachment;
> filename=" + requestedFile.getName());
>
> if (!requestedFile.exists()) {
> logger.error("file doesnt exist : " + filePath);
> }
>
> ServletOutputStream out = null;
> RandomAccessFile inputFile = null;
>
> try {
> inputFile = new RandomAccessFile(requestedFile,
> "r");
>
> Long contentLength =
> Long.valueOf(inputFile.length());
>
> response.setContentLength(contentLength.intValue());
>
> out = response.getOutputStream();
>
> byte[] buffer = new byte[4096];
> int read = 0;
> int totalRead = 0;
>
> try {
> while ((read = inputFile.read(buffer)) >
> 0) {
> out.write(buffer, 0, read);
> totalRead += read;
> out.flush();
> }
> } catch (EOFException e) {
> out.flush();
> out.close();
> } finally {
>
> if (out != null) {
> out.flush();
> out.close();
> }
> if (inputFile != null) {
> inputFile.close();
> }
> }
>
>
> } catch (IOException e) {
> logger.error(e.getMessage(), e);
> } finally {
> filePath = null;
> requestedFile = null;
> out = null;
> inputFile = null;
> }
>
> I hope it helps you finding a way to solve your problem...
>
> Yours,
>
> Marcus Milanez
>
> -----Mensagem original-----
> De: Andreas [mailto:sardanapalos928@hotmail.com]
> Enviada em: quinta-feira, 24 de abril de 2008 11:14
> Para: Tomcat Users List
> Assunto: Re: Runtime created files not accessible.Please help.
>
> mmm, I am not sure i got what you mean by "listed", but I will try to
> describe to you the situation.
>
> catalina home:  C:\Program Files\Apache Software Foundation\Tomcat 6.0
> my project folder:   C:\Program Files\Apache Software Foundation\Tomcat
> 6.0\PROTEUS_9
> (i build-deploy-run it through NetBeans 6.0.1)
>
> web folder of project(containing pages) : C:\Program Files\Apache
> Software Foundation\Tomcat 6.0\PROTEUS_9\web
>
> usersessions folder:  C:\Program Files\Apache Software Foundation\Tomcat
> 6.0\PROTEUS_9\web\UserSessions
>
> an istance of a created folder at runtime is this: C:\Program
> Files\Apache Software Foundation\Tomcat
> 6.0\PROTEUS_9\web\UserSessions\admin_Thu_Apr_24_00.30.09_2008
>
> and here is where i put everything the user downloads or creates,  so
> that he will b able to retrieve it after the end of session.
>
> If by chance you would like to warn me for the dots '.' in the path name
> or the capital letters , I could say tha I have tried to create simple
> path names without any dots or special characters and i had the same
> problem.
>
> Thnx so much.
>
> Andreas.
>
> ----- Original Message -----
> From: "Milanez, Marcus" <Ma...@diebold.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Thursday, April 24, 2008 4:44 PM
> Subject: RES: Runtime created files not accessible.Please help.
>
>
>
> Could you please list the part of your code where you list the created
> files? Where are they located, inside your webapp folder?
>
> Yours,
>
> Marcus Milanez
>
> -----Mensagem original-----
> De: Andreas [mailto:sardanapalos928@hotmail.com]
> Enviada em: quinta-feira, 24 de abril de 2008 10:39
> Para: Tomcat Users List
> Assunto: Re: Runtime created files not accessible.Please help.
>
> Hello and many thnx for interest and help.
>
> Yes, I do see the folders/files created by Java code during runtime with
> file viewers, they seem all fine.
>
> But tomcat won't open/see them, and even if i try to put the URL in my
> browser I get HTTP Status 404.
>
> The code is pretty much basic, Java.IO , FileReader/Writer and so on.
>
> Tell me  please if i can be more specific or I should post something
> more.
>
> Thanx a lot,
>
> Best Regards,
>
> Andreas, Greece.
>
> ----- Original Message -----
> From: "Milanez, Marcus" <Ma...@diebold.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Thursday, April 24, 2008 4:28 PM
> Subject: RES: Runtime created files not accessible.Please help.
>
>
> Hi Andreas,
>
> We do pretty much the same here and it is working fine. Could you please
> post some parts of your code, so that we can see how you specify your
> physical folders? Can you see the folders/files created using a file
> viewer ?
>
> Yours,
>
> Marcus Milanez
>
> -----Mensagem original-----
> De: Andreas [mailto:sardanapalos928@hotmail.com]
> Enviada em: quinta-feira, 24 de abril de 2008 10:22
> Para: users@tomcat.apache.org
> Assunto: Runtime created files not accessible.Please help.
>
> Hello everyone!
>
> I have developed a jsf(java server faces) web application running on
> tomcat 6.0 .
>
> Maybe my questions will be a bit naive, but i kindly ask for your help
> since i am not able to find solution myself.
>
> The problem is this:
>
> My web server needs to create new folders and write files in the folders
> so that the end user will b able to download later.
> The files I download or I create though, and save in my new folders
> created at runtime, are not available for tomcat...
> I get HTTP Status 404 , and I am unable to open them at runtime back
> from the local disk.
>
> So, what should I do to make the newly created folders and files
> instantly available in Tomcat without restarting???
> And what is the proper place for someone to put his application folder??
>
> Thank you very much for your help...
>
>
> Andreas, Greece.
>
> ---------------------------------------------------------------------
> 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
>
>
>
> ---------------------------------------------------------------------
> 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


RES: Runtime created files not accessible.Please help.

Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Hello,

I meant any class that extends HttpServlet. Have you tried the code I
sent you?

Marcus Milanez 

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com] 
Enviada em: quinta-feira, 24 de abril de 2008 17:06
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

Hello Marcus, Hello all.

Thank you very for ur help,although i dont seem to get any solution and
it's just completely frustrating...

Marcus, when you say regular servlet you mean..?? simple JSP ?
I am not sure I got it.

Coz I also tested through a simple JSP and I got the same problems...

Best Regards,

Andreas.

---------------------------------------------------------------------
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: Runtime created files not accessible.Please help.

Posted by Andreas <sa...@hotmail.com>.
Hello Marcus, Hello all.

Thank you very for ur help,although i dont seem to get any solution and it's 
just completely frustrating...

Marcus, when you say regular servlet you mean..?? simple JSP ?
I am not sure I got it.

Coz I also tested through a simple JSP and I got the same problems...

Best Regards,

Andreas.

----- Original Message ----- 
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 5:33 PM
Subject: RES: Runtime created files not accessible.Please help.



Andreas,

Can you read the created files/folder using a regular servlet? If you
can do it so, I would advice you to dispatch download requests to this
servlet, read the requested file and then write it in response.
Something like this (in your doPost or doGet):

response.setContentType("application/x-msdownload");

String filePath = getServletContext().getRealPath("/") +
"your-correct-path" + request.getParameter("fileName");

File requestedFile = new File(filePath);

response.addHeader("Content-Disposition", "attachment;
filename=" + requestedFile.getName());

if (!requestedFile.exists()) {
logger.error("file doesnt exist : " + filePath);
}

ServletOutputStream out = null;
RandomAccessFile inputFile = null;

try {
inputFile = new RandomAccessFile(requestedFile,
"r");

Long contentLength =
Long.valueOf(inputFile.length());

response.setContentLength(contentLength.intValue());

out = response.getOutputStream();

byte[] buffer = new byte[4096];
int read = 0;
int totalRead = 0;

try {
while ((read = inputFile.read(buffer)) >
0) {
out.write(buffer, 0, read);
totalRead += read;
out.flush();
}
} catch (EOFException e) {
out.flush();
out.close();
} finally {

if (out != null) {
out.flush();
out.close();
}
if (inputFile != null) {
inputFile.close();
}
}


} catch (IOException e) {
logger.error(e.getMessage(), e);
} finally {
filePath = null;
requestedFile = null;
out = null;
inputFile = null;
}

I hope it helps you finding a way to solve your problem...

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 11:14
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

mmm, I am not sure i got what you mean by "listed", but I will try to
describe to you the situation.

catalina home:  C:\Program Files\Apache Software Foundation\Tomcat 6.0
my project folder:   C:\Program Files\Apache Software Foundation\Tomcat
6.0\PROTEUS_9
(i build-deploy-run it through NetBeans 6.0.1)

web folder of project(containing pages) : C:\Program Files\Apache
Software Foundation\Tomcat 6.0\PROTEUS_9\web

usersessions folder:  C:\Program Files\Apache Software Foundation\Tomcat
6.0\PROTEUS_9\web\UserSessions

an istance of a created folder at runtime is this: C:\Program
Files\Apache Software Foundation\Tomcat
6.0\PROTEUS_9\web\UserSessions\admin_Thu_Apr_24_00.30.09_2008

and here is where i put everything the user downloads or creates,  so
that he will b able to retrieve it after the end of session.

If by chance you would like to warn me for the dots '.' in the path name
or the capital letters , I could say tha I have tried to create simple
path names without any dots or special characters and i had the same
problem.

Thnx so much.

Andreas.

----- Original Message -----
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:44 PM
Subject: RES: Runtime created files not accessible.Please help.



Could you please list the part of your code where you list the created
files? Where are they located, inside your webapp folder?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:39
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

Hello and many thnx for interest and help.

Yes, I do see the folders/files created by Java code during runtime with
file viewers, they seem all fine.

But tomcat won't open/see them, and even if i try to put the URL in my
browser I get HTTP Status 404.

The code is pretty much basic, Java.IO , FileReader/Writer and so on.

Tell me  please if i can be more specific or I should post something
more.

Thanx a lot,

Best Regards,

Andreas, Greece.

----- Original Message -----
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:28 PM
Subject: RES: Runtime created files not accessible.Please help.


Hi Andreas,

We do pretty much the same here and it is working fine. Could you please
post some parts of your code, so that we can see how you specify your
physical folders? Can you see the folders/files created using a file
viewer ?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:22
Para: users@tomcat.apache.org
Assunto: Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on
tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help
since i am not able to find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders
so that the end user will b able to download later.
The files I download or I create though, and save in my new folders
created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back
from the local disk.

So, what should I do to make the newly created folders and files
instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

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



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


RES: Runtime created files not accessible.Please help.

Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Andreas,

Can you read the created files/folder using a regular servlet? If you
can do it so, I would advice you to dispatch download requests to this
servlet, read the requested file and then write it in response.
Something like this (in your doPost or doGet):

		response.setContentType("application/x-msdownload");
		
		String filePath = getServletContext().getRealPath("/") +
"your-correct-path" + request.getParameter("fileName");
		
		File requestedFile = new File(filePath);

		response.addHeader("Content-Disposition", "attachment;
filename=" + requestedFile.getName());
		
		if (!requestedFile.exists()) {
			logger.error("file doesnt exist : " + filePath);
		}
		
		ServletOutputStream out = null;
		RandomAccessFile inputFile = null;
		
		try {
			inputFile = new RandomAccessFile(requestedFile,
"r");
			
			Long contentLength =
Long.valueOf(inputFile.length());
	
response.setContentLength(contentLength.intValue());
			
			out = response.getOutputStream();

			byte[] buffer = new byte[4096];
			int read = 0;
			int totalRead = 0;
			
			try {
				while ((read = inputFile.read(buffer)) >
0) {
					out.write(buffer, 0, read);
					totalRead += read;
					out.flush();
				}    
			} catch (EOFException e) {
				out.flush();
				out.close();
			} finally {
			
				if (out != null) {
					out.flush();
					out.close();
				}
				if (inputFile != null) {
					inputFile.close();	
				}
			}

			
		} catch (IOException e) {
			logger.error(e.getMessage(), e);
		} finally {
			filePath = null;
			requestedFile = null;
			out = null;
			inputFile = null;			
		} 

I hope it helps you finding a way to solve your problem...

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com] 
Enviada em: quinta-feira, 24 de abril de 2008 11:14
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

mmm, I am not sure i got what you mean by "listed", but I will try to
describe to you the situation.

catalina home:  C:\Program Files\Apache Software Foundation\Tomcat 6.0
my project folder:   C:\Program Files\Apache Software Foundation\Tomcat 
6.0\PROTEUS_9
(i build-deploy-run it through NetBeans 6.0.1)

web folder of project(containing pages) : C:\Program Files\Apache
Software Foundation\Tomcat 6.0\PROTEUS_9\web

usersessions folder:  C:\Program Files\Apache Software Foundation\Tomcat
6.0\PROTEUS_9\web\UserSessions

an istance of a created folder at runtime is this: C:\Program
Files\Apache Software Foundation\Tomcat
6.0\PROTEUS_9\web\UserSessions\admin_Thu_Apr_24_00.30.09_2008

and here is where i put everything the user downloads or creates,  so
that he will b able to retrieve it after the end of session.

If by chance you would like to warn me for the dots '.' in the path name
or the capital letters , I could say tha I have tried to create simple
path names without any dots or special characters and i had the same
problem.

Thnx so much.

Andreas.

----- Original Message -----
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:44 PM
Subject: RES: Runtime created files not accessible.Please help.



Could you please list the part of your code where you list the created
files? Where are they located, inside your webapp folder?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:39
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

Hello and many thnx for interest and help.

Yes, I do see the folders/files created by Java code during runtime with
file viewers, they seem all fine.

But tomcat won't open/see them, and even if i try to put the URL in my
browser I get HTTP Status 404.

The code is pretty much basic, Java.IO , FileReader/Writer and so on.

Tell me  please if i can be more specific or I should post something
more.

Thanx a lot,

Best Regards,

Andreas, Greece.

----- Original Message -----
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:28 PM
Subject: RES: Runtime created files not accessible.Please help.


Hi Andreas,

We do pretty much the same here and it is working fine. Could you please
post some parts of your code, so that we can see how you specify your
physical folders? Can you see the folders/files created using a file
viewer ?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:22
Para: users@tomcat.apache.org
Assunto: Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on
tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help
since i am not able to find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders
so that the end user will b able to download later.
The files I download or I create though, and save in my new folders
created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back
from the local disk.

So, what should I do to make the newly created folders and files
instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

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


RES: Runtime created files not accessible.Please help.

Posted by "Milanez, Marcus" <Ma...@diebold.com>.
I don't think so, never noticed it in our applications... 

-----Mensagem original-----
De: Piller Sébastien [mailto:pills@hmcrecord.ch] 
Enviada em: quinta-feira, 24 de abril de 2008 11:22
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

Hello,

personnally, I noticed that there is a delay between the creation of a folder/file and the moment where this folder/file is available in my webapp...

I don't know why, but seems to be related to tomcat

---------------------------------------------------------------------
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: Runtime created files not accessible.Please help.

Posted by Piller Sébastien <pi...@hmcrecord.ch>.
Hello,

personnally, I noticed that there is a delay between the creation of a 
folder/file and the moment where this folder/file is available in my 
webapp...

I don't know why, but seems to be related to tomcat


Andreas a écrit :
> mmm, I am not sure i got what you mean by "listed", but I will try to 
> describe to you the situation.
>
> catalina home:  C:\Program Files\Apache Software Foundation\Tomcat 6.0
> my project folder:   C:\Program Files\Apache Software 
> Foundation\Tomcat 6.0\PROTEUS_9
> (i build-deploy-run it through NetBeans 6.0.1)
>
> web folder of project(containing pages) : C:\Program Files\Apache 
> Software Foundation\Tomcat 6.0\PROTEUS_9\web
>
> usersessions folder:  C:\Program Files\Apache Software 
> Foundation\Tomcat 6.0\PROTEUS_9\web\UserSessions
>
> an istance of a created folder at runtime is this: C:\Program 
> Files\Apache Software Foundation\Tomcat 
> 6.0\PROTEUS_9\web\UserSessions\admin_Thu_Apr_24_00.30.09_2008
>
> and here is where i put everything the user downloads or creates,  so 
> that he will b able to retrieve it after the end of session.
>
> If by chance you would like to warn me for the dots '.' in the path 
> name or the capital letters , I could say tha I have tried to create 
> simple path names without
> any dots or special characters and i had the same problem.
>
> Thnx so much.
>
> Andreas.
>
> ----- Original Message ----- From: "Milanez, Marcus" 
> <Ma...@diebold.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Thursday, April 24, 2008 4:44 PM
> Subject: RES: Runtime created files not accessible.Please help.
>
>
>
> Could you please list the part of your code where you list the created
> files? Where are they located, inside your webapp folder?
>
> Yours,
>
> Marcus Milanez
>
> -----Mensagem original-----
> De: Andreas [mailto:sardanapalos928@hotmail.com]
> Enviada em: quinta-feira, 24 de abril de 2008 10:39
> Para: Tomcat Users List
> Assunto: Re: Runtime created files not accessible.Please help.
>
> Hello and many thnx for interest and help.
>
> Yes, I do see the folders/files created by Java code during runtime with
> file viewers, they seem all fine.
>
> But tomcat won't open/see them, and even if i try to put the URL in my
> browser I get HTTP Status 404.
>
> The code is pretty much basic, Java.IO , FileReader/Writer and so on.
>
> Tell me  please if i can be more specific or I should post something
> more.
>
> Thanx a lot,
>
> Best Regards,
>
> Andreas, Greece.
>
> ----- Original Message -----
> From: "Milanez, Marcus" <Ma...@diebold.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Thursday, April 24, 2008 4:28 PM
> Subject: RES: Runtime created files not accessible.Please help.
>
>
> Hi Andreas,
>
> We do pretty much the same here and it is working fine. Could you please
> post some parts of your code, so that we can see how you specify your
> physical folders? Can you see the folders/files created using a file
> viewer ?
>
> Yours,
>
> Marcus Milanez
>
> -----Mensagem original-----
> De: Andreas [mailto:sardanapalos928@hotmail.com]
> Enviada em: quinta-feira, 24 de abril de 2008 10:22
> Para: users@tomcat.apache.org
> Assunto: Runtime created files not accessible.Please help.
>
> Hello everyone!
>
> I have developed a jsf(java server faces) web application running on
> tomcat 6.0 .
>
> Maybe my questions will be a bit naive, but i kindly ask for your help
> since i am not able to find solution myself.
>
> The problem is this:
>
> My web server needs to create new folders and write files in the folders
> so that the end user will b able to download later.
> The files I download or I create though, and save in my new folders
> created at runtime, are not available for tomcat...
> I get HTTP Status 404 , and I am unable to open them at runtime back
> from the local disk.
>
> So, what should I do to make the newly created folders and files
> instantly available in Tomcat without restarting???
> And what is the proper place for someone to put his application folder??
>
> Thank you very much for your help...
>
>
> Andreas, Greece.
>
> ---------------------------------------------------------------------
> 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: Runtime created files not accessible.Please help.

Posted by Andreas <sa...@hotmail.com>.
mmm, I am not sure i got what you mean by "listed", but I will try to 
describe to you the situation.

catalina home:  C:\Program Files\Apache Software Foundation\Tomcat 6.0
my project folder:   C:\Program Files\Apache Software Foundation\Tomcat 
6.0\PROTEUS_9
(i build-deploy-run it through NetBeans 6.0.1)

web folder of project(containing pages) : C:\Program Files\Apache Software 
Foundation\Tomcat 6.0\PROTEUS_9\web

usersessions folder:  C:\Program Files\Apache Software Foundation\Tomcat 
6.0\PROTEUS_9\web\UserSessions

an istance of a created folder at runtime is this: C:\Program Files\Apache 
Software Foundation\Tomcat 
6.0\PROTEUS_9\web\UserSessions\admin_Thu_Apr_24_00.30.09_2008

and here is where i put everything the user downloads or creates,  so that 
he will b able to retrieve it after the end of session.

If by chance you would like to warn me for the dots '.' in the path name or 
the capital letters , I could say tha I have tried to create simple path 
names without
any dots or special characters and i had the same problem.

Thnx so much.

Andreas.

----- Original Message ----- 
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:44 PM
Subject: RES: Runtime created files not accessible.Please help.



Could you please list the part of your code where you list the created
files? Where are they located, inside your webapp folder?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:39
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

Hello and many thnx for interest and help.

Yes, I do see the folders/files created by Java code during runtime with
file viewers, they seem all fine.

But tomcat won't open/see them, and even if i try to put the URL in my
browser I get HTTP Status 404.

The code is pretty much basic, Java.IO , FileReader/Writer and so on.

Tell me  please if i can be more specific or I should post something
more.

Thanx a lot,

Best Regards,

Andreas, Greece.

----- Original Message -----
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:28 PM
Subject: RES: Runtime created files not accessible.Please help.


Hi Andreas,

We do pretty much the same here and it is working fine. Could you please
post some parts of your code, so that we can see how you specify your
physical folders? Can you see the folders/files created using a file
viewer ?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:22
Para: users@tomcat.apache.org
Assunto: Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on
tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help
since i am not able to find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders
so that the end user will b able to download later.
The files I download or I create though, and save in my new folders
created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back
from the local disk.

So, what should I do to make the newly created folders and files
instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

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


RES: Runtime created files not accessible.Please help.

Posted by "Milanez, Marcus" <Ma...@diebold.com>.
 
Could you please list the part of your code where you list the created
files? Where are they located, inside your webapp folder?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com] 
Enviada em: quinta-feira, 24 de abril de 2008 10:39
Para: Tomcat Users List
Assunto: Re: Runtime created files not accessible.Please help.

Hello and many thnx for interest and help.

Yes, I do see the folders/files created by Java code during runtime with
file viewers, they seem all fine.

But tomcat won't open/see them, and even if i try to put the URL in my
browser I get HTTP Status 404.

The code is pretty much basic, Java.IO , FileReader/Writer and so on.

Tell me  please if i can be more specific or I should post something
more.

Thanx a lot,

Best Regards,

Andreas, Greece.

----- Original Message -----
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:28 PM
Subject: RES: Runtime created files not accessible.Please help.


Hi Andreas,

We do pretty much the same here and it is working fine. Could you please
post some parts of your code, so that we can see how you specify your
physical folders? Can you see the folders/files created using a file
viewer ?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:22
Para: users@tomcat.apache.org
Assunto: Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on
tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help
since i am not able to find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders
so that the end user will b able to download later.
The files I download or I create though, and save in my new folders
created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back
from the local disk.

So, what should I do to make the newly created folders and files
instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

---------------------------------------------------------------------
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: Runtime created files not accessible.Please help.

Posted by Andreas <sa...@hotmail.com>.
Hello and many thnx for interest and help.

Yes, I do see the folders/files created by Java code during runtime with 
file viewers, they seem all fine.

But tomcat won't open/see them, and even if i try to put the URL in my 
browser I get HTTP Status 404.

The code is pretty much basic, Java.IO , FileReader/Writer and so on.

Tell me  please if i can be more specific or I should post something more.

Thanx a lot,

Best Regards,

Andreas, Greece.

----- Original Message ----- 
From: "Milanez, Marcus" <Ma...@diebold.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, April 24, 2008 4:28 PM
Subject: RES: Runtime created files not accessible.Please help.


Hi Andreas,

We do pretty much the same here and it is working fine. Could you please
post some parts of your code, so that we can see how you specify your
physical folders? Can you see the folders/files created using a file
viewer ?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com]
Enviada em: quinta-feira, 24 de abril de 2008 10:22
Para: users@tomcat.apache.org
Assunto: Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on
tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help
since i am not able to find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders
so that the end user will b able to download later.
The files I download or I create though, and save in my new folders
created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back
from the local disk.

So, what should I do to make the newly created folders and files
instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

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


RES: Runtime created files not accessible.Please help.

Posted by "Milanez, Marcus" <Ma...@diebold.com>.
Hi Andreas,

We do pretty much the same here and it is working fine. Could you please
post some parts of your code, so that we can see how you specify your
physical folders? Can you see the folders/files created using a file
viewer ?

Yours,

Marcus Milanez

-----Mensagem original-----
De: Andreas [mailto:sardanapalos928@hotmail.com] 
Enviada em: quinta-feira, 24 de abril de 2008 10:22
Para: users@tomcat.apache.org
Assunto: Runtime created files not accessible.Please help.

Hello everyone!

I have developed a jsf(java server faces) web application running on
tomcat 6.0 .

Maybe my questions will be a bit naive, but i kindly ask for your help
since i am not able to find solution myself.

The problem is this:

My web server needs to create new folders and write files in the folders
so that the end user will b able to download later.
The files I download or I create though, and save in my new folders
created at runtime, are not available for tomcat...
I get HTTP Status 404 , and I am unable to open them at runtime back
from the local disk.

So, what should I do to make the newly created folders and files
instantly available in Tomcat without restarting???
And what is the proper place for someone to put his application folder??

Thank you very much for your help...


Andreas, Greece.

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