geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrie de Heer <adrie.deh...@gmail.com>
Subject NullPointerException after work-around for GERONIMO-5800
Date Tue, 06 Sep 2011 08:21:32 GMT
Hi,

A few months ago I've implemented a work-around for GERONIMO-5800 as
explained in the jira. The code in my servlet filter looks like this:

public void requestDestroyed(ServletRequestEvent sre) {
  // unregister current subject: work-around for GERONIMO-5800
  // (memory leak in  ContextManager.subjectContexts)
  Subject subject = ContextManager.getCurrentCaller();
  if (subject != null && !subject.isReadOnly()) {
    ContextManager.unregisterSubject(subject);
  }
}

This seems to be working fine but sometimes I get the following exception
(during heavy load?):
2011-09-05 22:16:53,383 ERROR [CoyoteAdapter] An exception or error occurred
in the container during the request processing
java.lang.NullPointerException
        at
org.apache.geronimo.security.ContextManager.getCurrentPrincipal(ContextManager.java:234)
        at
org.apache.geronimo.tomcat.security.impl.GeronimoLoginService.login(GeronimoLoginService.java:64)
        at
org.apache.geronimo.tomcat.security.impl.GeronimoLoginService.login(GeronimoLoginService.java:53)
        at
org.apache.geronimo.tomcat.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:109)
        at
org.apache.geronimo.tomcat.security.SecurityValve.invoke(SecurityValve.java:104)
        at
org.apache.geronimo.tomcat.security.jacc.JACCSecurityValve.invoke(JACCSecurityValve.java:54)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:420)
        at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) 
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:396)
        at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214)
        at
org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:344)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
        at java.lang.Thread.run(Unknown Source)

Can this exception be related to the work-around as it cleans up the
subjectContexts map or did I implement the work-around in the wrong way?

Regards,
Adrie

--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/NullPointerException-after-work-around-for-GERONIMO-5800-tp3312893p3312893.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message