Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Accessing ResourceBundles from a bundle


From looking at the ResourceBundle class, ResourceBundle.getBundle(String) will use the context class loader of the caller to locate the resource bundle. This means it will use the classloader of the bundle which loaded the class which defines the method which calls ResourceBundle.getBundle(String).

So if the class which defines the method comes from a different bundle (imported package) than the resource, the resource probably will not be located.

BJ Hargrave
Senior Software Engineer, IBM Pervasive Computing - Austin, TX
OSGi Fellow and CTO of the OSGi Alliance
mailto:hargrave@xxxxxxxxxx  902/6C-003 T/L 678-9938
Office: +1 512 838 9938  Mobile: +1 512 785 7386



"Pascal Rapicault" <Pascal_Rapicault@xxxxxxxxxx>
Sent by: equinox-dev-admin@xxxxxxxxxxx

2003-07-18 10:32 AM

       
        To:        equinox-dev@xxxxxxxxxxx
        cc:        
        Subject:        [equinox-dev] Accessing ResourceBundles from a bundle




Hi,


Is there any knwon problem using the java API   ResourceBundle.getResourceBundle(String baseName) from the code of a bundle?

It does not work in the implementation that I have.


       PaScaL


Back to the top