• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IBM MQ 'remote put' problem

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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-
 
reply
    Bookmark Topic Watch Topic
  • New Topic