Bug 49151

Summary: ClassCastException in BackupManager#stopInternal.
Product: Tomcat 6 Reporter: Keiichi Fujino <kfujino>
Component: ClusterAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 6.0.26   
Target Milestone: ----   
Hardware: All   
OS: All   

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.