tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Vysny <...@whitestein.com>
Subject OpenEJB local interfaces JNDI security
Date Tue, 17 Jun 2008 07:37:02 GMT
Hi guys,
  another issue ;) I tried to use JNDI security with OpenEJB - that is,
constructing InitialContext with properties Context.SECURITY_PRINCIPAL
and Context.SECURITY_CREDENTIALS set. It works beautifully, however when
another InitialContext is constructed (first one is closed using
Context.close()) the following exception occurs:

Caused by: javax.naming.NamingException: Cannot instantiate an IntraVM
InitialContext. Exception: javax.naming.AuthenticationException User
could not be authenticated: karolko [Root exception is
javax.naming.AuthenticationException: User could not be authenticated:
karolko [Root exception is javax.security.auth.login.LoginException:
Thread already associated with a client identity.  Refusing to
overwrite.]]
	at
org.apache.openejb.client.LocalInitialContextFactory.getIntraVmContext(LocalInitialContextFactory.java:116)
	at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:41)
	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
com.whitestein.fe.client.ejb.ClientCommunicationImpl.newClient(ClientCommunicationImpl.java:109)
	... 16 more
Caused by: javax.naming.AuthenticationException: User could not be
authenticated: karolko [Root exception is
javax.security.auth.login.LoginException: Thread already associated with
a client identity.  Refusing to overwrite.]
	at
org.apache.openejb.core.ivm.naming.InitContextFactory.getInitialContext(InitContextFactory.java:53)
	at
org.apache.openejb.client.LocalInitialContextFactory.getIntraVmContext(LocalInitialContextFactory.java:114)
	... 22 more
Caused by: javax.security.auth.login.LoginException: Thread already
associated with a client identity.  Refusing to overwrite.
	at
org.apache.openejb.core.security.AbstractSecurityService.associate(AbstractSecurityService.java:174)
	at
org.apache.openejb.core.security.AbstractSecurityService.associate(AbstractSecurityService.java:60)
	at
org.apache.openejb.core.ivm.naming.InitContextFactory.getInitialContext(InitContextFactory.java:51)
	... 23 more

Probably the client identity should be removed from ThreadLocal on
Context.close(), or J2SE security (doPrivileged) could be used to hold
the principal. Should I open a bug?
Thanks,
Martin


Mime
View raw message