aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes System.setSecurityManager(new RMISecurityManager()); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "System.setSecurityManager(new RMISecurityManager());" Watch "System.setSecurityManager(new RMISecurityManager());" New topic
Author

System.setSecurityManager(new RMISecurityManager());

thomas davis
Ranch Hand

Joined: Feb 01, 2003
Posts: 207
Why do we need to use the following lines while calling ejb form client (Servlet) ?
System.setSecurityManager(new RMISecurityManager());
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "allaire.ejipt.ContextFactory");
properties.setProperty(Context.PROVIDER_URL, "ejipt://127.0.0.1:2323");
Application Server Jrun 3.0
Could someone explain each and every step listed above?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Context.INITIAL_CONTEXT_FACTORY tells us the Contextimplementation and
Context.PROVIDER_URL the location of the JNDI server.


Groovy
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Why do we need to use the following lines while calling ejb form client (Servlet) ?
System.setSecurityManager(new RMISecurityManager());

I have never had to call System.setSecurityManager() for an EJB client -- be it standalone Java program, a servlet on the same server, or a servlet on a dedicated web container. Maybe JRun documentation explains the reason?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

We usually use the securitymanger when doing an RMI call using JRMP.
 
jQuery in Action, 2nd edition
 
subject: System.setSecurityManager(new RMISecurityManager());