You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by clay johnson <cl...@opentext.com> on 2016/06/30 20:19:37 UTC

javax.security.auth.login.LoginException: Thread already associated with a client identity. Refusing to overwrite.

I've seen some older postings regarding this exception, but none seem to
apply to my situation.  Any ideas/clues would be appreciated.

My application involves a number of timers and mdbs that do a variety of
server-side ejb lookups and calls without any problem.  But as soon as I
"login" to the application through any webapp console, I see this exception. 
The particular stack trace below is from the tomee scripting
(http://localhost:8080/tomee-webaccess-1.7.4/scripting) servlet, which
doesn't even try to log in, as far as I know.  It seems as though the thread
"clientIdentity" states are corrupt.


WARNING - Unexpected exception resolving reference
java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy85.create(Unknown Source)
        at
org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference.getObject(BusinessLocalBeanReference.java:36)
        at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:175)
        at
org.apache.openejb.core.ivm.naming.IntraVmJndiReference.getObject(IntraVmJndiReference.java:42)
        at
org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:38)
        at
org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:174)
        at
org.apache.openejb.server.cxf.rs.CdiResourceProvider$InitialContextWrapper.invoke(CdiResourceProvider.java:231)
        at com.sun.proxy.$Proxy131.lookup(Unknown Source)
        at
org.apache.openejb.InjectionProcessor.fillInjectionProperties(InjectionProcessor.java:216)
        at
org.apache.openejb.InjectionProcessor.construct(InjectionProcessor.java:120)
        at
org.apache.openejb.InjectionProcessor.createInstance(InjectionProcessor.java:91)
        at
org.apache.openejb.server.cxf.rs.CdiResourceProvider$DefaultBeanCreator.doInit(CdiResourceProvider.java:344)
        at
org.apache.openejb.server.cxf.rs.CdiResourceProvider$DefaultBeanCreator.create(CdiResourceProvider.java:322)
        at
org.apache.openejb.server.cxf.rs.CdiResourceProvider.getInstance(CdiResourceProvider.java:171)
        at
org.apache.cxf.jaxrs.JAXRSInvoker.getServiceObject(JAXRSInvoker.java:380)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:96)
        at
org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
        at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
        at
org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:251)
        at
org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at
org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
        at
org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:632)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
        at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
        at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
        at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
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:225)
        at
org.apache.openejb.core.security.AbstractSecurityService.associate(AbstractSecurityService.java:63)
        at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:314)
        ... 59 more



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/javax-security-auth-login-LoginException-Thread-already-associated-with-a-client-identity-Refusing-t-tp4679162.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: javax.security.auth.login.LoginException: Thread already associated with a client identity. Refusing to overwrite.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Only case I can think about like that is a missed logout but I have more in
mind the 7.x branch which got several enhancements compared to the 1.7.x on
that area so can also be a fixed bug.

Using the 7.x is not an option?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-07-01 16:02 GMT+02:00 clay johnson <cl...@opentext.com>:

> Thanks for reply.
>
> Unfortunately, I don't have a sample project to reproduce it.  We are in
> the
> initial phase of migrating a large application from weblogic, and we are
> encountering this problem.
>
> That's why I illustrate the problem occurring as well with the ootb tomee
> scripting webapp.  Since I assume that webapp is trusted to operate
> correctly, the fact it suffers from this problem suggests to me there has
> been some collateral damage of the ThreadLocal "clientIdentity" state
> asserted by the AbstractSecurityService#associate method.  I assume that
> damage is caused by some improper behavior of our other webapps that
> attempt
> to authenticate.  I am just hoping others may have seen this problem and
> can
> suggest possible causes.
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/javax-security-auth-login-LoginException-Thread-already-associated-with-a-client-identity-Refusing-t-tp4679162p4679178.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: javax.security.auth.login.LoginException: Thread already associated with a client identity. Refusing to overwrite.

Posted by clay johnson <cl...@opentext.com>.
Thanks for reply.  

Unfortunately, I don't have a sample project to reproduce it.  We are in the
initial phase of migrating a large application from weblogic, and we are
encountering this problem.

That's why I illustrate the problem occurring as well with the ootb tomee
scripting webapp.  Since I assume that webapp is trusted to operate
correctly, the fact it suffers from this problem suggests to me there has
been some collateral damage of the ThreadLocal "clientIdentity" state
asserted by the AbstractSecurityService#associate method.  I assume that
damage is caused by some improper behavior of our other webapps that attempt
to authenticate.  I am just hoping others may have seen this problem and can
suggest possible causes.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/javax-security-auth-login-LoginException-Thread-already-associated-with-a-client-identity-Refusing-t-tp4679162p4679178.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: javax.security.auth.login.LoginException: Thread already associated with a client identity. Refusing to overwrite.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hello

are you able to reproduce it in a sample project you can share (github is a
good place fro that)?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-06-30 22:19 GMT+02:00 clay johnson <cl...@opentext.com>:

> I've seen some older postings regarding this exception, but none seem to
> apply to my situation.  Any ideas/clues would be appreciated.
>
> My application involves a number of timers and mdbs that do a variety of
> server-side ejb lookups and calls without any problem.  But as soon as I
> "login" to the application through any webapp console, I see this
> exception.
> The particular stack trace below is from the tomee scripting
> (http://localhost:8080/tomee-webaccess-1.7.4/scripting) servlet, which
> doesn't even try to log in, as far as I know.  It seems as though the
> thread
> "clientIdentity" states are corrupt.
>
>
> WARNING - Unexpected exception resolving reference
> java.lang.reflect.UndeclaredThrowableException
>         at com.sun.proxy.$Proxy85.create(Unknown Source)
>         at
>
> org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference.getObject(BusinessLocalBeanReference.java:36)
>         at
> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:175)
>         at
>
> org.apache.openejb.core.ivm.naming.IntraVmJndiReference.getObject(IntraVmJndiReference.java:42)
>         at
> org.apache.openejb.core.ivm.naming.Reference.getContent(Reference.java:38)
>         at
>
> org.apache.xbean.naming.reference.SimpleReference$SimpleObjectFactory.getObjectInstance(SimpleReference.java:137)
>         at
> javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:840)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:160)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:828)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:174)
>         at
>
> org.apache.openejb.server.cxf.rs.CdiResourceProvider$InitialContextWrapper.invoke(CdiResourceProvider.java:231)
>         at com.sun.proxy.$Proxy131.lookup(Unknown Source)
>         at
>
> org.apache.openejb.InjectionProcessor.fillInjectionProperties(InjectionProcessor.java:216)
>         at
>
> org.apache.openejb.InjectionProcessor.construct(InjectionProcessor.java:120)
>         at
>
> org.apache.openejb.InjectionProcessor.createInstance(InjectionProcessor.java:91)
>         at
>
> org.apache.openejb.server.cxf.rs.CdiResourceProvider$DefaultBeanCreator.doInit(CdiResourceProvider.java:344)
>         at
>
> org.apache.openejb.server.cxf.rs.CdiResourceProvider$DefaultBeanCreator.create(CdiResourceProvider.java:322)
>         at
>
> org.apache.openejb.server.cxf.rs.CdiResourceProvider.getInstance(CdiResourceProvider.java:171)
>         at
> org.apache.cxf.jaxrs.JAXRSInvoker.getServiceObject(JAXRSInvoker.java:380)
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:96)
>         at
>
> org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
>         at
>
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
>         at
>
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
>         at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>         at
>
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>         at
>
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
>         at
>
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:251)
>         at
>
> org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
>         at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
>         at
> org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
>         at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
>         at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
>         at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
>         at
> org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
>         at
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:632)
>         at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
>         at
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
>         at
>
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
>         at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
>         at
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
>         at
>
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>         at
>
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
>         at
>
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
>         at
>
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at
>
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:745)
> 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:225)
>         at
>
> org.apache.openejb.core.security.AbstractSecurityService.associate(AbstractSecurityService.java:63)
>         at
>
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:314)
>         ... 59 more
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/javax-security-auth-login-LoginException-Thread-already-associated-with-a-client-identity-Refusing-t-tp4679162.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>