Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-3978

Util class tries to locate resource bundles using TCCL, which fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 7.0.0.CR1
    • None
    • Clustering
    • None
    • Regression, Blocks Testing
    • Hide

      In EAP 7.0.0.ER7, deploy an application containing a persistence.xml containing this

      <property name="hibernate.cache.use_second_level_cache" value="true" />
      <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory" />
      
      Show
      In EAP 7.0.0.ER7, deploy an application containing a persistence.xml containing this <property name="hibernate.cache.use_second_level_cache" value="true" /> <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory" />

      This causes JPA applications with 2LC backed by org.hibernate.cache.infinispan.InfinispanRegionFactory to not work. Applications using org.jboss.as.jpa.hibernate5.infinispan.InfinispanRegionFactory seem to work.

      org.jgroups.util.Util class tries to locate jg-messages bundle using the TCCL, not its own class loader. In a Java SE environment, this typically doesn't matter, because the class loaders are the same, but in EAP, this means that jg-messages is sought by the class loader of the application rather than the class loader of JGroups module, which is obviously wrong. This is the offending line: https://github.com/belaban/JGroups/blob/74d3da4f6b04e941b3751e6ac97ed154718fb583/src/org/jgroups/util/Util.java#L104

      The call to getBundle fails with a MissingResourceException (see http://docs.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html#getBundle%28java.lang.String,%20java.util.Locale,%20java.lang.ClassLoader%29) and because this code is in a static initializer, the Util class becomes unusable.

              pferraro@redhat.com Paul Ferraro
              jmartisk@redhat.com Jan Martiska
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: