geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevan Miller (JIRA)" <>
Subject [jira] Commented: (GERONIMO-2100) Subject can remain attached to thread on return from web app request, causing problems later on subsequent use of that thread
Date Fri, 09 Jun 2006 23:56:30 GMT
    [ ] 

Kevan Miller commented on GERONIMO-2100:

For posterity, here's the error that you get:

07:47:21,992 WARN  [SystemExceptionInterceptor] MyEjbTest
java.lang.AssertionError: No registered context
	at org.openejb.slsb.StatelessInstanceInterceptor.invoke(
	at org.openejb.transaction.ContainerPolicy$TxSupports.invoke(
	at org.openejb.transaction.TransactionContextInterceptor.invoke(
	at org.openejb.SystemExceptionInterceptor.invoke(
	at org.openejb.GenericEJBContainer$DefaultSubjectInterceptor.invoke(
	at org.openejb.GenericEJBContainer.invoke(
	at org.openejb.GenericEJBContainer$$FastClassByCGLIB$$60a0c356.invoke(<generated>)
	at net.sf.cglib.reflect.FastMethod.invoke(
	at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(
	at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(
	at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(
	at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(
	at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(
	at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(
	at org.openejb.EJBContainer$$EnhancerByCGLIB$$19a9c94a.invoke(<generated>)
	at org.openejb.server.axis.EJBContainerProvider.processMessage(
	at org.apache.axis.strategies.InvocationStrategy.visit(
	at org.apache.axis.SimpleChain.doVisiting(
	at org.apache.axis.SimpleChain.invoke(
	at org.apache.axis.handlers.soap.SOAPService.invoke(
	at org.apache.geronimo.axis.server.AxisWebServiceContainer.invoke(
	at org.apache.geronimo.jetty.JettyEJBWebServiceContext.handle(
	at org.mortbay.http.HttpServer.service(
	at org.mortbay.http.HttpConnection.service(
	at org.mortbay.http.HttpConnection.handleNext(
	at org.mortbay.http.HttpConnection.handle(
	at org.mortbay.http.SocketListener.handleConnection(
	at org.mortbay.util.ThreadedServer.handle(
	at org.mortbay.util.ThreadPool$

> Subject can remain attached to thread on return from web app request, causing problems
later on subsequent use of that thread
> -----------------------------------------------------------------------------------------------------------------------------
>          Key: GERONIMO-2100
>          URL:
>      Project: Geronimo
>         Type: Bug
>     Security: public(Regular issues) 
>   Components: web
>     Versions: 1.2, 1.1
>     Reporter: David Jencks
>     Assignee: David Jencks
>     Priority: Blocker
>      Fix For: 1.2, 1.1

> there's no code to reset ContextManager.currentCaller in the jetty integration.  It gets
set o.m.j.servlet.WebApplicationHandler.dispatch checking security credentials >>>>>>
InternalJAASJettyRealm, and also by JettyEJBWebServiceContext somewhat more directly.
> The problem appears to occur when a subject is left on a thread and the thread is used
for an unauthenticated ejb web services call.  The responsibility for setting the subject
on unauthenticated ejb web services calls is too distributed, but what actually sets it is
GenericEJBContainer.DefaultSubjectInterceptor, which only installs the defaultSubject if there
is no subject already set.
> A minimal fix is to set the currentCaller to null if no authentication is needed in JettyEJBWebServiceContext:
>                 if (authenticator != null) {
>                     String pathInContext = org.mortbay.util.URI.canonicalPath(req.getPath());
>                     if (authenticator.authenticate(realm, pathInContext, req, res) ==
null) {
>                         throw new HttpException(403);
>                     }
>                 } else {
>                     //EJB will figure out correct defaultSubject shortly
>                     //TODO Need to check that the handler chain will see the correct
>                     ContextManager.setCurrentCaller(null);
>                 }
> However, it would be much better to make sure that in addition the subject can't escape
back into the calling environment.  This can be done easily in JettyEJBWebServiceContext but
requires a simple subclass of o.m.j.servletWebApplicationHandler for normal servlet requests.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message