Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-1778

Change classloader strategy to load version from non system classloader

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      At present when initializing the StorageService, FBUtilities.getReleaseVersionString() tries to load the version.info resource from the ClassLoader.getSystemClassLoader(). This typically fails in an embedded scenario (such as an OSGi container) resulting in a dummy version at INFO and a stacktrace at WARN

      logger_.warn("Unable to load version.properties", e);
      return "debug version";

      My guess is that changing the implementation to using the FBUtilities.class.getClassLoader() for loading resources would solve it and will work in almost any case I can think off. However, as discussed on the Apache Felix mailing list, the only "right"way to do it is to allow an optional ClassLoader to be specified (@see http://www.mail-archive.com/users@felix.apache.org/msg09060.html).

      This issue was initially reported at the Amdatu jira:
      http://jira.amdatu.org/jira/browse/AMDATU-127

      Attachments

        Activity

          People

            bramk Bram de Kruijff
            bramk Bram de Kruijff
            Bram de Kruijff
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: