Hi
I'm trying to get a standalone application to be able to access session beans in my jboss 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
This is the code I'm using:

27: InitialContext ctx;
28: Properties env = new Properties();
29:
30: env.setProperty(Context.SECURITY_PRINCIPAL, "user");
31: env.setProperty(Context.SECURITY_CREDENTIALS, "password");
32: env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
33: env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
34: ctx = new InitialContext(env);

When I execute it throws the following exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.jboss.security.jndi.SecurityAssociationActions$SetPrincipalInfoAction.run (SecurityAssociationActions.java:51)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.security.jndi.SecurityAssociationActions.setPrincipalInfo(SecurityAssociationActions.java:62)
    at org.jboss.security.jndi.JndiLoginInitialContextFactory.getInitialContext(JndiLoginInitialContextFactory.java:79)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at javax.naming.InitialContext.getDefaultInitCtx (InitialContext.java:247)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at Utils.main(Utils.java:34)

The last line points at "ctx = new InitialContext(env);"

If I understand things correctly this has nothing todo with what user or password I'm using since that check isn't made
before I actually call a method on a bean.

So, is there any configuration that has be made in JBoss to allow "external" client to access the JNDI tree?

Thanks
Jonathan

_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to