|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Loading properties file from a plugin node |
« View previous topic :: View next topic » |
Author |
Message
|
asalema |
Posted: Wed Jul 07, 2004 12:27 pm Post subject: Loading properties file from a plugin node |
|
|
Apprentice
Joined: 05 May 2003 Posts: 35
|
Hi All,
This might be trivial to some people, but I am unable to load a properties file from a plugin node using ResourceBundle.getBundle(filename) method
The problem here is that I don't know where I should put (deploy) the properties file, I tried to copy it to WMQIB_HOME/bin, WMQIB_HOME, and that didn't work. I also tried to put it in a directory (e.g. \properties) and add this directory to the system classpath, and that didn't work either because I think WMQIB uses a special VM separate from the default VM setup on the system. So, my question is
If I want to use ResourceBunle, How do I configure WMQIB classpath to add the location of the properties file in there?
Thx |
|
Back to top |
|
 |
kirani |
Posted: Wed Jul 07, 2004 3:46 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
What data are you passing in filename?
Can you post example filepath here? _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 07, 2004 4:19 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you try putting it in the same folder as your plugin - either WBIMB_HOME/bin or WBIMB_HOME/jplugin ? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
asalema |
Posted: Thu Jul 08, 2004 9:23 am Post subject: |
|
|
Apprentice
Joined: 05 May 2003 Posts: 35
|
Hi jefflowrey and kirani,
Thx very much for your reply.
First, I did try to put it in the same directory with the plugin which is WMQIB_HOME\bin and it was not picked up.
And here is a code excerpt:
this is the code I am using now:
....................
String PFileName = "resources";
PropertyResourceBundle p = PropertyResourceBundle.getBundle(PFileName);
String qMgrName = p.getString("Queue.Manager");
....................
I tried to open the file explicitly and then create the bundle like so:
.................................................
FileInputStream fis = new FileInputStream( PFileName) ;
PropertyResourceBundle p = new PropertyResourceBundle(fis);
String qMgrName = p.getString("Queue.Manager");
.................................................
This seems to work fine. However, this code does not take into consideration the system default Locale for example if I have multiple resource files like so:
resources.properties
resources_fr_ca.properties
resources_fr.properties
.......
Regards, |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jul 08, 2004 9:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If this is a java plugin, it should not be in WBIMB_HOME/bin, it should be in WBIMB_HOME/jplugin.
That is, you should put the jar file for your plug-in there.
Also, you could try including the resource bundle in your jar file. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
alphacentari |
Posted: Fri Jul 09, 2004 7:09 am Post subject: |
|
|
Novice
Joined: 15 May 2004 Posts: 12
|
Did you try having it in <WMQI Install>/tool/<your_package_hirarchy>/ directory.
Have it there and add the same path to your classpath, restart broker. It should work. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|