Klient, JNDI, System.setSecurityManager

K

karol1208

I have implemented session bean. I have no problem to connect via JNDI
in his same
EJB conteiner. But when I try to connect in the client I get error.

I suspect it's somthing with System.setSecurityManager.

if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
System.out.println("brak RMISecurityManager");
}

Hashtable p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.security.jndi.JndiLoginInitialContextFactory");
p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
p.put(Context.SECURITY_PRINCIPAL, "admin");
p.put(Context.SECURITY_CREDENTIALS, "password");

javax.naming.InitialContext ic = new
javax.naming.InitialContext(p);

I get error:
Exception in thread "AWT-EventQueue-0"
java.lang.ExceptionInInitializerError
at org.jboss.security.jndi.SecurityAssociationActions
$SetPrincipalInfoAction.run(SecurityAssociationActions.java:72)
at java.security.AccessController.doPrivileged(Native Method)
at
org.jboss.security.jndi.SecurityAssociationActions.setPrincipalInfo(SecurityAssociationActions.java:
110)
at
org.jboss.security.jndi.JndiLoginInitialContextFactory.getInitialContext(JndiLoginInitialContextFactory.java:
105)

how to setup correct System.setSecurityManager in the client? Where
should be file "client.policy"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,208
Latest member
RandallLay

Latest Threads

Top