|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting Missing resource Exception Wyl calling getCurrentDep |
« View previous topic :: View next topic » |
Author |
Message
|
HARSH DUBEY |
Posted: Tue Mar 08, 2011 10:40 am Post subject: Getting Missing resource Exception Wyl calling getCurrentDep |
|
|
Newbie
Joined: 08 Mar 2011 Posts: 2
|
Hello programmers,
I have a requirement to get the current depth and max depth of a queue.
I am using MQ predefined function to calculate the depth. but I am getting missing resource exception while running this program..
here is the piece of code...
import com.ibm.mq.MQC;
import com.ibm.mq.MQException;
import com.ibm.mq.MQQueueManager;
public class MQFix {
public static int getDepth() throws MQException
{
int i=0, openOptions=0;
com.ibm.mq.MQQueueManager qMgr= null;
com.ibm.mq.MQQueue destinationQueue = null;
com.ibm.mq.MQEnvironment.hostname = "host name";
com.ibm.mq.MQEnvironment.channel = "channel name";
com.ibm.mq.MQEnvironment.port = 5009;
String QMGR = "name of qmgr";
String RECEIVEQUE = "Name of the queue";
System.out.println("RECEIVEQUE "+RECEIVEQUE+"");
String RACFID = null;
qMgr = new MQQueueManager(QMGR);
System.out.println("qMgr "+qMgr+"");
openOptions = MQC.MQOO_INQUIRE | MQC.MQOO_INPUT_AS_Q_DEF;
destinationQueue = qMgr.accessQueue(RECEIVEQUE, openOptions, null, null, RACFID);
i = destinationQueue.getCurrentDepth();
destinationQueue.close();
qMgr.disconnect();
return i;
}
public static void main(String[] args) throws MQException {
System.out.println("Enter :MQFix inside Main method");
System.out.println("Calling GetDepth");
int depth = MQFix.getDepth();
System.out.println("Depth returned"+ depth);
System.out.println("Exit :MQFix inside Main method");
}
}
and this is the exception I am getting..
Enter :MQFix inside Main method
Calling GetDepth
RECEIVEQUE queue name
qMgr com.ibm.mq.MQQueueManager@5c085c08
Exception in thread "main" java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key 39
at java.util.ResourceBundle.getObject(Unknown Source)
at java.util.ResourceBundle.getString(Unknown Source)
at com.ibm.mq.MQException.<init>(MQException.java:630)
at com.ibm.mq.MQManagedObject.inquire(MQManagedObject.java:257)
at com.ibm.mq.MQManagedObject.getInt(MQManagedObject.java:428)
at com.ibm.mq.MQQueue.getCurrentDepth(MQQueue.java:904)
at package name.MQFix.getDepth(MQFix.java:41)
at package name.MQFix.main(MQFix.java:176)
------------
Please
 |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 08, 2011 11:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So you have a requirement that is not aligned with best practices.
Besides that, the most likely cause of your actual trouble is that you have not installed a full MQ client on the machine in which you are trying to run the code, you have merely moved some jar files around. |
|
Back to top |
|
 |
HARSH DUBEY |
Posted: Fri Mar 11, 2011 11:55 pm Post subject: |
|
|
Newbie
Joined: 08 Mar 2011 Posts: 2
|
hello jeff,
thanks for the quick response...
can you please let me know, from where I can download or get all the related jar files. |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Mar 12, 2011 8:05 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You can download the full client from IBM's website.
If you can't find it on your own, you should tell this to your manager and get his or her assistance. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Sat Mar 12, 2011 1:23 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Ask that same manager why you are tasked with reinventing an MQ monitoring application, and doesn't your company already have a tool that monitors MQ. _________________ Peter Potkay
Keep Calm and MQ On |
|
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
|
|
|
|