[jboss-jira] [JBoss JIRA] Created: (JBCACHE-895) ClassCastException in GlobalTransaction#equals()

Stas Chizhov (JIRA) jira-events at jboss.com
Wed Dec 6 03:20:55 EST 2006


ClassCastException in GlobalTransaction#equals()
------------------------------------------------

                 Key: JBCACHE-895
                 URL: http://jira.jboss.com/jira/browse/JBCACHE-895
             Project: JBoss Cache
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 2.0.0.ALPHA1
            Reporter: Stas Chizhov
         Assigned To: Manik Surtani


Looks like GobalTransaction semantics allows addr property to be null.
GlobalTransaction#compareTO(other) method (used by equals()) handles this.adrr == null situation, but does not check for other.adrr == null.

Here is corresponding line from from GlobalTransaction#compareTO()
comp=addr != null ? addr.compareTo(other.addr) : 0;

Nearly any Adress#comapreTO() implementation treats null as illegal argument.
IpAdress#compareTO() for instance throws ClassCastException in this case.
So if globalTransaction1.addr!= null & globalTransaction2.addr==null globaltransaction1.equals(globalTransaction2) will fail with ClassCastException,
but globaltransaction2.equals(globalTransaction1) will not.

We observe this issue running JBoss 4.0.2 with default JBossCache and JGroups under following conditions:
1) Have 2 JBoss nodes being put under moderate transaction rate 
2) have 1 node paused inside a transaction (either manually via debugger or long GC pause) for a time greater then JGroups FD timeout.
   After cluster node rejoin we observe this issue in logs:
Caused by: java.lang.ClassCastException: IpAddress.compareTo(): comparison between different classes
 at org.jgroups.stack.IpAddress.compareTo(IpAddress.java:134)
 at org.jboss.cache.GlobalTransaction.compareTo (GlobalTransaction.java:72)
 at org.jboss.cache.GlobalTransaction.equals(GlobalTransaction.java:63


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list