Hi I have some example JavaMail code. I have deployed it into my application. However, it complains about denied access to 1 line, system properties. Can you tell me how to overcome this problem and the best way to integrate this into my application (i.e. session bean). Thanks!
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
5
posted
0
Could you reproduce the actual error message for us?
Thanks for the reply... Here is the exception: java.security.AccessControlException: access denied (java.util.PropertyPermission * read,write) This happens when I try to get system properties in order to connect to my mail server. I also tried some other code from Sun that uses JSP with the JavaMail. I tried it and I get the same error. I am sure that it is a security setting, but I am not sure how to do this in the descriptor.
P.Jamieson
Greenhorn
Joined: Apr 30, 2003
Posts: 21
posted
0
I was able to make a change in the security.policy file from a "read" permission to a "read,write" permission. That has solved the problem. However, is this the best way? Have I compromized my web security? As follows... // permissions for default domain grant { permission java.net.SocketPermission "*", "connect"; permission java.util.PropertyPermission "*", "read,write";
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
5
posted
0
In general, you should keep your security on as tight a leech as possible. I'd try to add another grant for the "read, write" PropertyPermission for a more specific code base instead of "everything".
P.Jamieson
Greenhorn
Joined: Apr 30, 2003
Posts: 21
posted
0
Thanks, I'll give that a try...
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.