ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Loading properties file from a plugin node

Post new topic  Reply to topic
 Loading properties file from a plugin node « View previous topic :: View next topic » 
Author Message
asalema
PostPosted: Wed Jul 07, 2004 12:27 pm    Post subject: Loading properties file from a plugin node Reply with quote

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
View user's profile Send private message
kirani
PostPosted: Wed Jul 07, 2004 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Wed Jul 07, 2004 4:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
asalema
PostPosted: Thu Jul 08, 2004 9:23 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Jul 08, 2004 9:52 am    Post subject: Reply with quote

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
View user's profile Send private message
alphacentari
PostPosted: Fri Jul 09, 2004 7:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Loading properties file from a plugin node
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.