Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access Denied

 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I had uploaded a war file on Godaddy server and it exploded successfully around 1:00 AM Arizona time. The uploaded web application has a JSP with form which allows a user to enter a name of his/her choice and on submission respective folder will be created(based on the name entered by the user) on the server under the above deployed web-application. But the things is that i am getting an exception after submission of the form as (locally on Tomcat the directory is created perfectly)


Caught Exception: java.security.AccessControlException: access denied (java.io.FilePermission /var/chroot/home/content/b/r/i/bringlifeto/html/MyDemoDirApp/demodir/testdir write)

For you reference here is the code for JSP and Servlet

index.jsp


UserDirDemo.java


web.xml



After getting this exception, I had set the "Write" permission for the deployed web-application through our hosting account on GoDaddy

Kindly put some light on this issue

Regards,
Arpit U. Gadle
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The write permission is for the file / dir that you are trying to write to. Does your provider allow you to modify the permission of that file / dir ?

So you are using one of those shared accounts where they restart tomcat once everyday at X PM. eek. Coupled with restricted access to everything, I wonder what code you can deploy on such a server. I would recommend that you get yourself a better config to play around with. I ll stop there, since this topic actually dilutes your original question and the discussion.

I had uploaded a war file on Godaddy server and it exploded successfully around 1:00 AM Arizona time.


Explosions huh
 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepak,
Thanks for replying. Can you explain me what exactly you are trying to say. Is the code which I had written is wrong or I should get a new hosting account with other server which gives more flexibility.

Thanks
 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Arpit,



You are getting this exception while creating the directory. mkdirs function throws this exception when the user under which your app is executing does not have necessary right's to create the directory.

you might need to discuss with domain provider to get folder creation privilege as well.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following:


will probably not work - ALL classes used in servlets/jsp should be in packages. The reason being that the JVM will try to load this class from the "current" directory, something you have not control over.

Bill
 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:The following:


will probably not work - ALL classes used in servlets/jsp should be in packages. The reason being that the JVM will try to load this class from the "current" directory, something you have not control over.

Bill


Hey Bill,
The issue is I am getting Exception as Access Denied. I have read on net that there is Policy under Tomcat/conf directory which allows different permission settings.
Is the exception related to the configuration defined in the policy file

Arpit
 
Somnath Mallick
Ranch Hand
Posts: 482
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could be. But first check if the path you are trying to create the directory in has the required permission. Check with chmod and find out the permission of the directory.
 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Somnath,
Thanks for you reply. My Directory Creation web-app is deployed on a shared Linux server(GoDaddy and it uses Tomcat). I cant fire chmod command which allows me to set permission of files and directory.
And also I don't have access to catalina.policy file of the tomcat, in which i edit the permissions.

There are two types of policy file one is the default one that comes with JDK and Tomcat and the other is user created which is specific to a user developed application and is placed in the app (i don't know where). Can you tell me something about this.


Thanks
Arpit
 
Somnath Mallick
Ranch Hand
Posts: 482
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope this is of some help...

http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic