423255 MBeans of SessionIdManager can leak memory on redeploy
This commit is contained in:
parent
cf3acd376f
commit
dd0f50fc72
|
@ -227,11 +227,25 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
|
||||||
_sessionIdManager=server.getSessionIdManager();
|
_sessionIdManager=server.getSessionIdManager();
|
||||||
if (_sessionIdManager==null)
|
if (_sessionIdManager==null)
|
||||||
{
|
{
|
||||||
|
//create a default SessionIdManager and set it as the shared
|
||||||
|
//SessionIdManager for the Server, being careful NOT to use
|
||||||
|
//the webapp context's classloader, otherwise if the context
|
||||||
|
//is stopped, the classloader is leaked.
|
||||||
|
ClassLoader serverLoader = server.getClass().getClassLoader();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Thread.currentThread().setContextClassLoader(serverLoader);
|
||||||
_sessionIdManager=new HashSessionIdManager();
|
_sessionIdManager=new HashSessionIdManager();
|
||||||
server.setSessionIdManager(_sessionIdManager);
|
server.setSessionIdManager(_sessionIdManager);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Thread.currentThread().setContextClassLoader(_loader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_sessionIdManager.isStarted())
|
if (!_sessionIdManager.isStarted())
|
||||||
_sessionIdManager.start();
|
_sessionIdManager.start();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue