Bug 49151 - ClassCastException in BackupManager#stopInternal.
ClassCastException in BackupManager#stopInternal.
Product: Tomcat 6
Classification: Unclassified
Component: Cluster
All All
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2010-04-19 05:02 UTC by Keiichi Fujino
Modified: 2010-04-22 04:49 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2010-04-19 05:02:32 UTC
In BackupManager#startInternal,
When constructor of LazyReplicatedMap throws exception, 
sessions is not LazyReplicatedMap.
Actually, AbstractReplicatedMap#init has the possibility of throwing RuntimeException. 

In BackupManager#stopInternal ClassCastException is thrown 
because AbstractReplicatedMap#breakdown is executed regardless of the type of sessions. 

should be changed as follows to avoid ClassCastException. 
if (sessions instanceof LazyReplicatedMap) {
    LazyReplicatedMap map = (LazyReplicatedMap)sessions;
    if ( map!=null ) {

This problem exists in Tomcat7.0 and 6.0.

Best Regards.
Comment 1 Keiichi Fujino 2010-04-19 06:29:11 UTC
Fixed in trunk and proposed for 6.0.x.
Comment 2 Mark Thomas 2010-04-20 15:46:04 UTC
Moving to 6 since this is fixed in trunk
Comment 3 Keiichi Fujino 2010-04-22 04:49:49 UTC
This fix applied to 6.0, will be in 6.0.27 onwards.