Re: Apache Tomcat - Access Files Outside Webroot

2011-10-26 Thread Jmscavaleiro
Hello Alan,

Thank you very much for your reply. My problem is solved.

Unfortunately Apache didn't wrote any exception on catalina.out log.
And yes, you were right, it was a problem of paths. Simply i didn't
create a new File with the absolute path of the destination location,
i was using only the docs/filename.txt assuming that the File classe
would recognize the full path knowing the location in the filesystem
of the app. With Eclipse/Jetty it works but with Apache Tomcat don't.

Once again, thanks for you help, you really convinced me that my
problem was related to paths (Like one friend induced me to). But in
the matteer of fact, the debbug was not easy, the debbug mode with
external server don't work in the server side in the peace of code
where i make this io operations (strange), and the System.out.println
don't show up in the catalina.stdout (strange to and yes, i have
compiled and deployed it on the Apache Tomcat with that modifications
twice).

Thanks,
João Cavaleiro.

On Oct 25, 1:55 pm, Alan Chaney a...@mechnicality.com wrote:
 Jo o

 On 10/25/2011 1:44 AM, Jmscavaleiro wrote: Hello everyone,

  I had deployed my GWT application in the application server Apache
  Tomcat. My GWT application needs to access files in folder C:
  \Storage. In development mode the application runs like a charm but
  in an external web server (Apache Tomcat) it does not run, crashes
  when it tries to copy files from C:\Storage to \docs. I think this
  might be because i'm trying to access files outside the webroot. How
  can i solve this situation? Using apache commons libs to deal with
  files? Could be permissions? I need some enlightment, some help will
  be very apreciated.

 This is something that I do all the time so its your setup that's at fault.

 Are you seeing any exceptions in the log files - logs/catalina.out would
 be a good place
 to look. You can use the standard java.io.*classes such as File ,
 FileReader, FileWriter to make
 the transfers.  I suspect that you have an error in the way the paths
 are created in your production
 server.

 Another possibility is that you have a security manager in place - once
 again, check your logs.

 Alan









  Thanks in advance,
  Jo o Cavaleiro.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Apache Tomcat - Access Files Outside Webroot

2011-10-26 Thread Thad
You might want to take this up with the Tomcat user's list, but let me
offer some ideas.

First, I'll second what Alan says:  Read your Tomcat logs.

Second, where is \docs? Inside your $CATALINA_HOME/webapp/MyApp
directory? You can't rely on that directory being writable or even
being there. Tomcat unpacks your war by default, but it can be set not
to do so. Not unpacking is the default in some web servers. I suspect
that Tomcat is not permitting you to copy to a subdirectory inside
$CATALINA_HOME/webapp/MyApp for just that reason.

If the user account that launches Tomcat can read C:\Storage, there's
no reason you can't copy from there. I do this a lot. However I then
use servlets to write the file to back to my user (into an IFRAME or
new window). I don't copy it into a directory my webapp's tree and
tell the browser to access it.

On Oct 25, 4:44 am, Jmscavaleiro jmscavale...@gmail.com wrote:
 Hello everyone,

 I had deployed my GWT application in the application server Apache
 Tomcat. My GWT application needs to access files in folder C:
 \Storage. In development mode the application runs like a charm but
 in an external web server (Apache Tomcat) it does not run, crashes
 when it tries to copy files from C:\Storage to \docs. I think this
 might be because i'm trying to access files outside the webroot. How
 can i solve this situation? Using apache commons libs to deal with
 files? Could be permissions? I need some enlightment, some help will
 be very apreciated.

 Thanks in advance,
 João Cavaleiro.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Apache Tomcat - Access Files Outside Webroot

2011-10-25 Thread Jmscavaleiro
Hello everyone,

I had deployed my GWT application in the application server Apache
Tomcat. My GWT application needs to access files in folder C:
\Storage. In development mode the application runs like a charm but
in an external web server (Apache Tomcat) it does not run, crashes
when it tries to copy files from C:\Storage to \docs. I think this
might be because i'm trying to access files outside the webroot. How
can i solve this situation? Using apache commons libs to deal with
files? Could be permissions? I need some enlightment, some help will
be very apreciated.

Thanks in advance,
João Cavaleiro.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Apache Tomcat - Access Files Outside Webroot

2011-10-25 Thread Jmscavaleiro
Hello everyone,

I had deployed my GWT application in the application server Apache
Tomcat. My GWT application needs to access files in folder C:
\Storage. In development mode the application runs like a charm but
in an external web server (Apache Tomcat) it does not run, crashes
when it tries to copy files from C:\Storage to \docs. I think this
might be because i'm trying to access files outside the webroot. How
can i solve this situation? Using apache commons libs to deal with
files? Could be permissions? I need some enlightment, some help will
be very apreciated.

Thanks in advance,
João Cavaleiro.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Apache Tomcat - Access Files Outside Webroot

2011-10-25 Thread Alan Chaney

João

On 10/25/2011 1:44 AM, Jmscavaleiro wrote:

Hello everyone,

I had deployed my GWT application in the application server Apache
Tomcat. My GWT application needs to access files in folder C:
\Storage. In development mode the application runs like a charm but
in an external web server (Apache Tomcat) it does not run, crashes
when it tries to copy files from C:\Storage to \docs. I think this
might be because i'm trying to access files outside the webroot. How
can i solve this situation? Using apache commons libs to deal with
files? Could be permissions? I need some enlightment, some help will
be very apreciated.

This is something that I do all the time so its your setup that's at fault.

Are you seeing any exceptions in the log files - logs/catalina.out would 
be a good place
to look. You can use the standard java.io.*classes such as File , 
FileReader, FileWriter to make
the transfers.  I suspect that you have an error in the way the paths 
are created in your production

server.

Another possibility is that you have a security manager in place - once 
again, check your logs.


Alan







Thanks in advance,
João Cavaleiro.



--
You received this message because you are subscribed to the Google Groups Google 
Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.