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 » IBM MQ Java / JMS » Getting Missing resource Exception Wyl calling getCurrentDep

Post new topic  Reply to topic
 Getting Missing resource Exception Wyl calling getCurrentDep « View previous topic :: View next topic » 
Author Message
HARSH DUBEY
PostPosted: Tue Mar 08, 2011 10:40 am    Post subject: Getting Missing resource Exception Wyl calling getCurrentDep Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Tue Mar 08, 2011 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
HARSH DUBEY
PostPosted: Fri Mar 11, 2011 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Sat Mar 12, 2011 8:05 am    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Sat Mar 12, 2011 1:23 pm    Post subject: Reply with quote

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
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 » IBM MQ Java / JMS » Getting Missing resource Exception Wyl calling getCurrentDep
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.