File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes IBM MQ 'remote put' problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "IBM MQ Watch "IBM MQ New topic
Author

IBM MQ 'remote put' problem

Gerald Luckenbill
Greenhorn

Joined: Nov 05, 2003
Posts: 15
Hi,
I can't get the following code to work when I am trying to access a queue remotly - the queue is on a Unix server and my java program, which contains this snipet, is sitting on a Windows client - I am new to JMS so it could be something obvious. But, this code works fine when I accessing a local queue on my windows client. I am using IBM MQSeries.
public String put() {
try {
QueueConnectionFactory factory = null;
factory = new MQQueueConnectionFactory();
((MQQueueConnectionFactory) factory).setHostName(my_hostname);
((MQQueueConnectionFactory) factory).setPort(my_port);
((MQQueueConnectionFactory) factory).setChannel(my_channel);
//don't think I need this setTargetClient do I?
//((com.ibm.mq.jms.MQQueue) queue).setTargetClient(
//JMSC.MQJMS_CLIENT_NONJMS_MQ);

((MQQueueConnectionFactory) factory).setQueueManager(my_queueManagerName);
System.out.println("break 1!");

PROGRAM BREAKS RIGHT HERE AT createQueueConnection WITH THE ERROR:
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'my_queue_manager_name'
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2058

my_connection = factory.createQueueConnection();
System.out.println("break 2!");
my_session = my_connection.createQueueSession(
true,
Session.AUTO_ACKNOWLEDGE);
System.out.println("break 3");
my_queue = (Queue) my_session.createQueue(my_queueName);
my_queueSender = my_session.createSender(my_queue);
etc. etc.

} //end put

-Many Thanks-
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IBM MQ 'remote put' problem