DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Sep 2005
    Posts
    1

    Security Manager refused file access for Java Mail

    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.mySiteName.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:1 811)
    org.apache.catalina.loader.WebappClassLoader.findResource(WebappClassLoader.java:920)
    org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:11 38)
    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

    p.s.
    Here is the code snippet

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

    the remarked line throws an exception that is caught and rethrown as JSPException to the browser
    Last edited by qiqbal; 09-14-2005 at 07:11 AM.

Similar Threads

  1. Replies: 2
    Last Post: 01-02-2002, 10:23 AM
  2. RE: Windows Security
    By Abdel Khelifa in forum VB Classic
    Replies: 15
    Last Post: 07-02-2001, 10:30 PM
  3. Replies: 0
    Last Post: 12-19-2000, 03:14 PM
  4. Replies: 0
    Last Post: 12-11-2000, 02:32 PM
  5. Replies: 0
    Last Post: 04-17-2000, 01:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links