• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet making RMI call: Security Exception

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JBoss as my Application server and trying to make an RMI call from that. Facing following exception. I googled and understood that its something to do with the Java 2 security issue. I tried to overcome that using the following lines of code in my servlet(RMI client) and RMI server

System.setProperty("java.security.policy","policy.all");
System.setSecurityManager(new RMISecurityManager());

where i grant AllPermissions. Even then facing the following issue. Is there some JBoss configuration which needs to be changed to get this working?

Help Appreciated.

java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:2000 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java :264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JBoss is ignoring your System property and starting up with its own security manager. Somewhere in the startup code there is presumably something that sets a security policy.

I don't know about JBoss, but in Tomcat's catalina.bat we find:

set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy

and in the java command line:

-Djava.security.policy=="%SECURITY_POLICY_FILE%

Bill
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic