Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
amir taghvayi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
amir taghvayi
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic