aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Security Manager refused file access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Security Manager refused file access" Watch "Security Manager refused file access" New topic
Author

Security Manager refused file access

Qaisar Iqbal
Greenhorn

Joined: Sep 13, 2005
Posts: 2
I am using javax.mail API(1.2), bundled with the j2ee package, for an automated email generation of user registration,and getting the following exception

access denied (java.io.FilePermission /web/tomcat/work/hosting/www.myDomanName.com/_/loader/META-INF write)

The full stack trace is
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
java.security.AccessController.checkPermission(AccessController.java:427)
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
java.io.File.mkdir(File.java:1119)
java.io.File.mkdirs(File.java:1148)
org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1811)
org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:920)
org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1138)
java.lang.Class.getResourceAsStream(Class.java:1998)
javax.mail.Session.loadProviders(Session.java:793)
javax.mail.Session.(Session.java:81)
javax.mail.Session.getInstance(Session.java:103)
website.Email.sendThanksToUser(Email.java:37)
blah
blah
blah

My site is designed using jsp
It uses a shared server instance (tomcat 5.0.27)
All other smtp configurations are fine, I 've tested them on my local server.
Some body Pls Help
Qaisar Iqbal
Greenhorn

Joined: Sep 13, 2005
Posts: 2
here is the code snippet:

Properties props = new Properties();
props.put("mail.smtp.host", "my.smtp.server");
// Session mailSession = Session.getInstance(props, null);

the remarked line of code throws an exception which is caught by which raises a JSPException, thrown to the browser.

Pls help ASAP
Thnx
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
While I don't know very much on the javax.mail API, have you checked the properties or security settings on that folder location?


Steve<br /> <br />No matter where you go, there you are.<br /> <br />"My evil self is at the door, and I have no power to stop it."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Security Manager refused file access