Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes my program  can not write in own file with tomcat5.32 + cpanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "my program  can not write in own file with tomcat5.32 + cpanel " Watch "my program  can not write in own file with tomcat5.32 + cpanel " New topic
Author

my program can not write in own file with tomcat5.32 + cpanel

amir taghvayi
Ranch Hand

Joined: Sep 16, 2011
Posts: 54
hi
i use tomcat5.32 + cpanel .

my code is :
<%
Properties p = new Properties() ;
String path = application.getRealPath("");
path +="/WEB-INF/classes/pack2/cookie.properties" ;
p.load(new FileInputStream(path));
p.setProperty("amir", "morteza") ;
p.store(new FileOutputStream(path), "this is a test");

%>

when requested get this error :

java.io.FileNotFoundException: /home/domainname/public_html/ROOT/WEB-INF/classes/pack2/cookie.properties (Permission denied)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:106)
java.io.FileInputStream.<init>(FileInputStream.java:66)
org.apache.jsp.newjsp_jsp._jspService(newjsp_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)

please help me !!!

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

YOu do not have permission to write into that folder. Besides, do you really want to to do this? Think of what will happen when it comes time to redeploy the application.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
amir taghvayi
Ranch Hand

Joined: Sep 16, 2011
Posts: 54
hi Bear Bibeault

the perms is 0644 but my program can not write in own files and it is not any error when deploy program .
help me !
 
Consider Paul's rocket mass heater.
 
subject: my program can not write in own file with tomcat5.32 + cpanel
 
Similar Threads
Properties file not found
whats wrong with this code?
Java.util.Properties Not Found During loading in Servlet/JSP Erro
where to put log4j.properties?
jar files in vista business