Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2365

Class cast exception when upgrading from 4.0.20 to 4.1.0 or 4.1.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 4.1.2
    • 4.1.0, 4.1.1
    • None
    • Hide

      Code snippet from the initialisation of my unit test, bails out at new JChannel():

          try {
            JChannel channel = new JChannel("./cfg/jgroups/tcp_fork.xml");
            channel.setName("UnitTest");
      ...
            channel.connect("UnitTest");
          } catch (Exception e) {
            LOG.warn("jgroups init",  e);
          }
      
      Show
      Code snippet from the initialisation of my unit test, bails out at new JChannel(): try { JChannel channel = new JChannel( "./cfg/jgroups/tcp_fork.xml" ); channel.setName( "UnitTest" ); ... channel.connect( "UnitTest" ); } catch (Exception e) { LOG.warn( "jgroups init" , e); }

    Description

      Updating from 4.0.20 to 4.1.1 I get
      "java.lang.ClassCastException: org.jgroups.protocols.CENTRAL_LOCK cannot be cast to org.jgroups.protocols.TP"
      when creating a JChannel using the same config as before. My config is tcp_fork.xml attached to this issue. The stack trace:

      java.lang.ClassCastException: org.jgroups.protocols.CENTRAL_LOCK cannot be cast to org.jgroups.protocols.TP
      	at org.jgroups.stack.Configurator.createProtocolsAndInitializeAttrs(Configurator.java:110) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.protocols.FORK.createForkStacks(FORK.java:273) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.protocols.FORK.createForkStacks(FORK.java:265) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.protocols.FORK.init(FORK.java:100) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:857) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:480) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.JChannel.init(JChannel.java:952) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.JChannel.<init>(JChannel.java:125) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at org.jgroups.JChannel.<init>(JChannel.java:107) ~[jgroups-4.1.1.Final.jar:4.1.1.Final]
      	at com.acceptis.accept.jgroups.config.JGroupsConfigurator.setConfiguration(JGroupsConfigurator.java:86) [main/:?]
      	at com.acceptis.framework.locking.impl.test.JGroupsLockManagerTest.setUp(JGroupsLockManagerTest.java:40) [test/:?]
      
      

      Attachments

        1. fork-stacks.xml
          0.5 kB
        2. tcp_fork.xml
          2 kB

        Activity

          People

            rhn-engineering-bban Bela Ban
            dl6lr Bernd Laengerich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: