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 » What's the problem of my code ? Got MQJMS1111: JMS1.1

Post new topic  Reply to topic
 What's the problem of my code ? Got MQJMS1111: JMS1.1 « View previous topic :: View next topic » 
Author Message
kun.leeing
PostPosted: Wed Nov 12, 2008 9:22 am    Post subject: What's the problem of my code ? Got MQJMS1111: JMS1.1 Reply with quote

Disciple

Joined: 27 Sep 2008
Posts: 171

'dspmqbrk -m DefaultQManager' shows running.

//************************My Code***************************

import javax.jms.*;

public class TopicLoad {

private static String qMgrName = "DefaultQManager";
private static String tName = "TopicLoad";


public static void main( String[] args ) throws JMSException {

Object[] adminObjects = new Object[2];
obtainAdminObjects( adminObjects );
TopicConnectionFactory tcf = (TopicConnectionFactory)adminObjects[0];
Topic t = (Topic)adminObjects[1];

TopicConnection conn = tcf.createTopicConnection();
conn.start();

TopicSession sess = conn.createTopicSession( false,
Session.AUTO_ACKNOWLEDGE );
TopicPublisher publisher = sess.createPublisher(t);
TextMessage msg = sess.createTextMessage();
msg.setText("A message from the 'TopicLoad' sample application");

publisher.publish(msg);
conn.close();
}

private static void obtainAdminObjects( Object[] outArray ) {
try {
com.ibm.mq.jms.MQTopicConnectionFactory tcf =
new com.ibm.mq.jms.MQTopicConnectionFactory();
tcf.setQueueManager(qMgrName);
tcf.setBrokerQueueManager(qMgrName);
tcf.setBrokerPubQueue("Sample.Pub"); //existed
tcf.setBrokerSubQueue("Sample.Sub");//existed
tcf.setBrokerControlQueue("Sample.Control");//existed

com.ibm.mq.jms.MQTopic t = new com.ibm.mq.jms.MQTopic();
t.setBaseTopicName(tName);
outArray[0] = tcf;
outArray[1] = t;
} catch( Exception e ) {
System.out.println("Error obtaining admin objects: "+e+"\nQuitting.");
System.exit(-1);
}
}
}

I got an error .
Exception in thread "main" javax.jms.JMSException: MQJMS1111: JMS1.1 no setting essential queue... How can I make this code run ?
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Nov 12, 2008 2:12 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Quote:
tcf.setBrokerPubQueue("Sample.Pub"); //existed
tcf.setBrokerSubQueue("Sample.Sub");//existed
tcf.setBrokerControlQueue("Sample.Control");//existed

Those queues are not in the JMS realm. Read up on your documentation
They should all be something like SYSTEM.JMS.*.... or SYSTEM.BROKER.* don't have the documentation at hand myself... and you have more time than me to look it up
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kun.leeing
PostPosted: Wed Nov 12, 2008 6:20 pm    Post subject: Reply with quote

Disciple

Joined: 27 Sep 2008
Posts: 171

Thanks,fjb_saper.
I've solved the problem after reading doc.
And I'll read documentation with great concentration.
Thx for your advice.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » What's the problem of my code ? Got MQJMS1111: JMS1.1
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.