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
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
Arpit U. Gadle
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.
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 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.
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
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.