Buggy code:
} TreeSet < DistributableSessionManager < O > . PassivationCheck > passivationChecks = new TreeSet < DistributableSessionManager < O > . PassivationCheck > ( ) ; try { SessionInvalidationTracker . suspend ( ) ; for ( Session s : this . sessions . values ( ) ) { if ( ! ( this . started ) ) return ; boolean likelyExpired = false ; String realId = null ; try { ClusteredSession < O > session = cast ( s ) ; realId = session . getRealId ( ) ; likelyExpired = expire ; if ( expire ) { likelyExpired = ( session . isValid ( false ) ) == false ; if ( likelyExpired && ( this . outdatedSessionChecker . isSessionOutdated ( session ) ) ) { loadSession ( session . getRealId ( ) ) ; } if ( ! ( session . isValid ( ) ) ) continue ; likelyExpired = false ; } if ( passivate ) { passivationChecks . add ( new PassivationCheck ( session ) ) ; } } catch ( Exception e ) { if ( likelyExpired ) { bruteForceCleanup ( realId , e ) ; } else { log . error ( WebMessages . MESSAGES . failToPassivateLoad ( realId ) , e ) ; } } } long maxUnrep = ( ( maxUnreplicatedInterval ) < 0 ) ? 60 : maxUnreplicatedInterval ; for ( Map . Entry < String , OwnedSessionUpdate > entry : this . unloadedSessions . entrySet ( ) ) { if ( ! ( this . started ) ) return ; String realId = entry . getKey ( ) ; OwnedSessionUpdate osu = entry . getValue ( ) ; boolean likelyExpired = false ; long now = System . currentTimeMillis ( ) ; long elapsed = now - ( osu . getUpdateTime ( ) ) ; try { likelyExpired = ( expire && ( ( osu . getMaxInactive ( ) ) >= 1 ) ) && ( elapsed >= ( ( ( osu . getMaxInactive ( ) ) + maxUnrep ) * 1000L ) ) ; if ( likelyExpired ) { if ( osu . isPassivated ( ) ) { Session session = findSession ( realId ) ; if ( session != null ) { session . isValid ( ) ; continue ; } } this . distributedCacheManager . removeSessionLocal ( realId , osu . getOwner ( ) ) ; unloadedSessions . remove ( realId ) ; this . getReplicationStatistics ( ) . removeStats ( realId ) ; } else if ( passivate && ( ! ( osu . isPassivated ( ) ) ) ) { passivationChecks . add ( new PassivationCheck ( realId , osu ) ) ; } } catch ( Exception e ) { if ( likelyExpired ) { bruteForceCleanup ( realId , e ) ; } else { log . error ( WebMessages . MESSAGES . failToPassivateUnloaded ( realId ) , e ) ; } } } if ( ! ( this . started ) ) return ; if ( passivate ) { for ( DistributableSessionManager < O > . PassivationCheck passivationCheck : passivationChecks ) { try { long timeNow = System . currentTimeMillis ( ) ; long timeIdle = timeNow - ( passivationCheck . getLastUpdate ( ) ) ; if ( ( passivationMax >= 0 ) && ( timeIdle > passivationMax ) ) { passivationCheck . passivate ( ) ; } else if ( ( ( ( ( maxActiveAllowed ) > 0 ) && ( passivationMin > 0 ) ) && ( ( DistributableSessionManager . calcActiveSessions ( ) ) >= ( maxActiveAllowed ) ) ) && ( timeIdle > passivationMin ) ) { passivationCheck . passivate ( ) ; } else { break ; } } catch ( Exception e ) { log . error ( WebMessages . MESSAGES . failToPassivate ( ( passivationCheck . isUnloaded ( ) ? "unloaded<seq2seq4repair_space>" : "" ) , passivationCheck . getRealId ( ) ) , e ) ; } } } } catch ( Exception ex ) { <START_BUG> log . error ( ( "processExpirationPassivation():<seq2seq4repair_space>failed<seq2seq4repair_space>with<seq2seq4repair_space>exception:<seq2seq4repair_space>" + ex ) , ex ) ; <END_BUG> } finally { SessionInvalidationTracker . resume ( ) ; } log . trace ( "processExpirationPassivation():<seq2seq4repair_space>Completed<seq2seq4repair_space>..." ) ; log . tracef ( "processExpirationPassivation():<seq2seq4repair_space>active<seq2seq4repair_space>sessions<seq2seq4repair_space>=<seq2seq4repair_space>%d" , DistributableSessionManager . calcActiveSessions ( ) ) ; log . tracef ( "processExpirationPassivation():<seq2seq4repair_space>expired<seq2seq4repair_space>sessions<seq2seq4repair_space>=<seq2seq4repair_space>%d" , expiredCounter . get ( ) ) ; if ( passivate ) { log . tracef ( "processExpirationPassivation():<seq2seq4repair_space>passivated<seq2seq4repair_space>count<seq2seq4repair_space>=<seq2seq4repair_space>%d" , getPassivatedSessionCount ( ) ) ; } } private ClusteredSession < O > loadSession ( String realId ) { } @ SuppressWarnings ( "unchecked" ) private ClusteredSession < O > createEmptyClusteredSession ( ) { } private void bruteForceCleanup ( String realId , Exception ex ) { } @ Override public Map . Entry < String , String > parse ( String sessionId ) { } @ Override public String createSessionId ( String realId , String jvmRoute ) { } @ Override protected int getTotalActiveSessions ( ) { } private void processSessionRepl ( ClusteredSession < O > session ) { } @ SuppressWarnings ( "unchecked" ) private ClusteredSession < O > cast ( Session session ) { } private class PassivationCheck implements Comparable < DistributableSessionManager < O > . PassivationCheck > { private final String realId ; private final OwnedSessionUpdate osu ; private final ClusteredSession < O > session ; private PassivationCheck ( String realId , OwnedSessionUpdate osu ) { } private PassivationCheck ( ClusteredSession < O > session ) { } private long getLastUpdate ( ) { } private void passivate ( ) { } private String getRealId ( ) { } private boolean isUnloaded ( ) { } @ Override public int compareTo ( DistributableSessionManager < O > . PassivationCheck o ) { } } private static class SemaphoreLock implements Lock { private final Semaphore semaphore ; SemaphoreLock ( Semaphore semaphore ) { } @ Override public void lock ( ) { } @ Override public void lockInterruptibly ( ) throws InterruptedException { } @ Override public Condition newCondition ( ) { }

Fix:
log . error ( WebMessages . MESSAGES . processExpirationPassivationException ( ex . getLocalizedMessage ( ) ) , ex ) ;