• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

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

 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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 !
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!