tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41682] New: - ClassCastException with BackupManager + debug logging
Date Thu, 22 Feb 2007 21:05:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41682>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41682

           Summary: ClassCastException with BackupManager + debug logging
           Product: Tomcat 6
           Version: 6.0.7
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: gjohnson@alpineaccess.com


(Still happening in 6.0.9, though that isn't an option in Bugzilla)

If I use the BackupManager for session replication AND turn on debug logging, I
get this exception when I try to invalidate the session:

java.lang.ClassCastException: org.apache.catalina.ha.session.BackupManager
cannot be cast to org.apache.catalina.ha.session.DeltaManager
	at org.apache.catalina.ha.session.DeltaSession.expire(DeltaSession.java:361)
	at org.apache.catalina.ha.session.DeltaSession.expire(DeltaSession.java:352)
	at org.apache.catalina.session.StandardSession.expire(StandardSession.java:660)
	at
org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1112)
	at
org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:150)

The bug is easy to find in the source.  If debug logging is enabled, it tries to
cast manager to DeltaManager without an instanceof, even though it is doing an
instanceof immediately after:

    public void expire(boolean notify, boolean notifyCluster) {
        String expiredId = getIdInternal();
        super.expire(notify);

        if (notifyCluster) {
            if (log.isDebugEnabled())
                log.debug(sm.getString("deltaSession.notifying",
                                       ((DeltaManager)manager).getName(),
                                       new Boolean(isPrimarySession()),
                                       expiredId));
            if ( manager instanceof DeltaManager ) {
                ( (DeltaManager) manager).sessionExpired(expiredId);
            }
        }
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message