Bug 49151 - ClassCastException in BackupManager#stopInternal.
Summary: ClassCastException in BackupManager#stopInternal.
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Cluster (show other bugs)
Version: 6.0.26
Hardware: All All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-19 05:02 UTC by Keiichi Fujino
Modified: 2010-04-22 04:49 UTC (History)
0 users



Attachments

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. 
===
skip.
if (sessions instanceof LazyReplicatedMap) {
    LazyReplicatedMap map = (LazyReplicatedMap)sessions;
    if ( map!=null ) {
        map.breakdown();
    }
}
skip.
===

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.