Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4259

Cellar should deal with configuration type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • cellar-4.0.0
    • cellar-4.0.1
    • cellar
    • None

    Description

      When Cellar sync configuration, it assumes that all properties are String. So, if an user stores another type (let say a Long), it results to a ClassCastException:

      java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
      at org.apache.karaf.cellar.hazelcast.HazelcastGroupManager.copyGroupConfiguration(HazelcastGroupManager.java:532)[174:org.apache.karaf.cellar.hazelcast:4.0.0]
      

      Cellar should use instanceof on configuration to "detect" the type instead of casting to String:

      Dictionary updatedProperties = new Properties();
                      Enumeration keyEnumeration = configAdminProperties.keys();
                      while (keyEnumeration.hasMoreElements()) {
                          String key = (String) keyEnumeration.nextElement();
                          String value = (String) configAdminProperties.get(key);
      

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            jbonofre Jean-Baptiste Onofré
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: