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

Problem with loading resources from the bundle root (/) in OSGI environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 3.6.19
    • None
    • Reproducible both on linux(centos 7.3) and windows 10, my project is using org.eclipse.equinox 3.6.0.v20100503, oracle jdk 1.8.0.212

    • Hide

      load jgroups-3.6.19.Final.jar from an OSGI project and try to instantiate JDBC_PING

      Show
      load jgroups-3.6.19.Final.jar from an OSGI project and try to instantiate JDBC_PING

      Util.java:108
      resource_bundle=ResourceBundle.getBundle("jg-messages",Locale.getDefault(),Util.class.getClassLoader());

      is crashing with:
      ...
      Caused by: java.util.MissingResourceException: Can't find bundle for base name jg-messages, locale en_US
      at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1581)
      at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1396)
      at java.util.ResourceBundle.getBundle(ResourceBundle.java:1091)
      at org.jgroups.util.Util.<clinit>(Util.java:108)
      ... 162 more

      found some relevant info here : https://stackoverflow.com/questions/7564370/importing-resources-from-osgi-bundle
      seems like OSGI doesn't really like resources residing in the bundle root ...

              rhn-engineering-bban Bela Ban
              stalyanov Orlin Stalyanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: