As an aside to what Richard mentioned, You should use
ServletContext.getResource(String resourcePath) method to access resources
within your web application. This would help in making your web application
more portable and easier to deploy.

regards

Pramod Nair

----- Original Message -----
From: "Richard Yee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 07, 2002 11:10 PM
Subject: Re: More File IO trouble


> Monte,
> The path that you show is a relative path and not an absolute path. put a
> leading '/' on the path and try it again.
>
> -Richard
>
>
> At 03:34 PM 9/7/2002 -0700, you wrote:
> >In order to process a user request to make changes to the
> >user's preference file, I have to write to a file from a Servlet.
> >When I try to write to the file I get the following exception:
> >
> >java.io.FileNotFoundException:
> >usr50/home/mgardne/public_html/servlets/artxml/pacman.xml
> >(No such file or directory)
> >         at java.io.FileOutputStream.open(Native Method)
> >         at java.io.FileOutputStream.(FileOutputStream.java:102)
> >         at java.io.FileOutputStream.(FileOutputStream.java:62)
> >         at java.io.FileOutputStream.(FileOutputStream.java:132)
> >         at java.io.FileWriter.(FileWriter.java:43)
> >         at art.Artist.writeTo(Artist.java:88)
> >         at art.Artist.writeTo(Artist.java:101)
> >         at artists.upload2_7._jspService(upload2_7.java:181)
> >         at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
> >         at
>
>org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
> >         at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
> >         at org.apache.tomcat.core.Handler.service(Handler.java:235)
> >         at
> >org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
> >         at
>
>org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:9
17)
> >         at
> >org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
> >         at
>
>org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Ajp13In
terceptor.java:341)
> >         at
>
>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
> >         at
>
>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.ja
va:516)
> >         at java.lang.Thread.run(Thread.java:479)
> >
> >
> >I have checked several times, and the file does in fact exists.  The file
> >and the directory which contains it both have full file permissions(777).
> >What could be causing this problem?
> >
> >--Monte Glenn Gardner
> >
>
>___________________________________________________________________________
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to