Hi, I use a method in my session bean that contains following code-fragment :
The problem is that I get an error in Runtime : " java.rmi.RemoteException: nested exception is: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write); nested exception is: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write)...." How exactly can I solve this problem? Thanks for any help. EDS email@example.com [ February 26, 2003: Message edited by: Erwin De Stercke ] [ February 26, 2003: Message edited by: Erwin De Stercke ]
In Java Network Programming by E R Harold published by Orielly he does - props = new props(); props.put ( "mail.host", "mail.cloud9.net" ); I see you have a different key. Where did you get it? Over here they talk about a mail.debug property. Have your tried that?
Thanks for your response. The example I use is partly taken from the book "Teach yourself J2ee in 21 days" from SAMS. The program works fine if used outside an EJB (thus a simple main class for example). Thanks to your reference to Sun FAQ, I think the problem has to do with granting access to the Property (because I use System.getProperties();. I followed the instruction in the FAQ by inserting a grant clause to the security policy file... but is still doesn't work. I also inserted session.setDebug(true) to my code to obtain more error-results...but I still don't get more information. I think the errorlist I get is all there is. Hereby the complete list.
I have already tried out the example from Sun. But the problem is that I use Sun One EE (free download / 60 days trial) and that the example uses the deploytool. The question remains then how to define my mail-session in the JNDI? Sun One uses the J2ee RI.
Why use System.getProperties()? These would be defining properties for the entire JVM, which is why your ejb container is complaining. You aren't playing nice with other EJBs! Use: Properties props = new Properties();
Thanks, My code is working now. But, I'm still interested in how to make a better solution in working it out with JNDI. The problem is that I don't find the right settings for Sun One EE. Any suggestions? Thanks, EDS