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 » Can not create topic connection

Post new topic  Reply to topic
 Can not create topic connection « View previous topic :: View next topic » 
Author Message
garfiny
PostPosted: Mon Jul 26, 2004 12:45 am    Post subject: Can not create topic connection Reply with quote

Novice

Joined: 23 Jul 2004
Posts: 19

Hi,

I always get the exception when i creates a Topic Connection by the following codes.
// The topic connection factory and connection are shared by all the threads
topicConnectionFactory = new MQTopicConnectionFactory( );
topicConnectionFactory.setTransportType(JMSC.MQJMS_TP_DIRECT_TCPIP);
topicConnectionFactory.setPort(port); // default is 1506

if (hostName != "")
{
topicConnectionFactory.setHostName(hostName);
}

conn = topicConnectionFactory.createTopicConnection();
conn.start( );

The exception :
com.ibm.mq.jms.JMSWrappedException: MQJMS6115: Exception raised when creating TopicConnection ,exception java.net.ConnectException: Connection refused: connect

Could anyone tell me what's problem with these code?

Thanks!
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Jul 26, 2004 7:25 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

My guess would be that you don't have a listener running on your queue manager. Are there any error messages in the AMQERR01.LOG file that give specifics on the actual tcp/ip failure?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
RogerLacroix
PostPosted: Mon Jul 26, 2004 8:08 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

If you are going to dynamically build your JNDI values then you need a SVRCONN channel name too.

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
vennela
PostPosted: Mon Jul 26, 2004 10:37 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Quote:
If you are going to dynamically build your JNDI values then you need a SVRCONN channel name too.


If you don't specify a SVRCONN in your JNDI object it will take the default SYSTEM.DEF.SVRCONN
Back to top
View user's profile Send private message Send e-mail Visit poster's website
garfiny
PostPosted: Mon Jul 26, 2004 6:30 pm    Post subject: Reply with quote

Novice

Joined: 23 Jul 2004
Posts: 19

hi,

I modified my code like below:
topicConnectionFactory = new MQTopicConnectionFactory();
topicConnectionFactory.setTransportType(JMSC.MQJMS_TP_DIRECT_TCPIP);
topicConnectionFactory.setPort(1414);
topicConnectionFactory.setQueueManager("WBRK_QM") ;
if (hostName != "")
{
topicConnectionFactory.setHostName(hostName);
}

conn = topicConnectionFactory.createTopicConnection();
conn.start( );

This time, it raised another exception:
The minimal clients authority cause exception com.ibm.disthubmq.spi.AuthException
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Jul 27, 2004 6:16 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Can you post the entire stack trace?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
OmPat
PostPosted: Tue Jul 27, 2004 6:18 am    Post subject: Reply with quote

Apprentice

Joined: 20 Jul 2004
Posts: 33
Location: Charlotte

we need to have full stack trace to identify the problem. Otherwise it would be a plain guessing.
_________________
IBM Certified WMQ V5.3 System Administrator
IBM Certified WMQ V5.3 Solutions Designer
Brainbench Certified MQ Expert
IBM Certified WMQI V2.1 Solutions Expert
IBM Certified WMQI V2.1 Specialist
Back to top
View user's profile Send private message
OmPat
PostPosted: Tue Jul 27, 2004 7:15 am    Post subject: Reply with quote

Apprentice

Joined: 20 Jul 2004
Posts: 33
Location: Charlotte

The minimal clients authority cause exception com.ibm.disthubmq.spi.AuthException


This problem is fixed in the latest CSD (CSD 7). IBM has a mention of this problem in their fix pack

79611 - JMS: JMS 1.1 connection fails
caught JMSException: com.ibm.mq.jms.JMSWrappedException:
MQJMS6115: An exception occurred while creating the
TopicConnection, exception java.io.IOException:
MQJMS6228: Minimal client authentication failed because
exception com.ibm.disthubmq.spi.AuthException.


So if you apply the latest fixpack you should be able to create the topic connection.

Njoy....
_________________
IBM Certified WMQ V5.3 System Administrator
IBM Certified WMQ V5.3 Solutions Designer
Brainbench Certified MQ Expert
IBM Certified WMQI V2.1 Solutions Expert
IBM Certified WMQI V2.1 Specialist
Back to top
View user's profile Send private message
garfiny
PostPosted: Tue Jul 27, 2004 7:14 pm    Post subject: Reply with quote

Novice

Joined: 23 Jul 2004
Posts: 19

These are my full exception stack trace.

com.ibm.mq.jms.JMSWrappedException: MQJMS6115: exception throwed when creating TopicConnection ,exception java.io.IOException: MQJMS6228: Exception cause the minial client authority com.ibm.disthubmq.spi.AuthException failed
at com.ibm.mq.jms.MQTopicConnectionFactory.createDirectTopicConnection(MQTopicConnectionFactory.java:664)
at com.ibm.mq.jms.MQTopicConnectionFactory.createDirectTopicConnection(MQTopicConnectionFactory.java:504)
at com.ibm.mq.jms.MQTopicConnectionFactory.createTopicConnection(MQTopicConnectionFactory.java:272)
at com.ibm.cn.fmmb.QuotationPubIp.main(QuotationPubIp.java:235)

I've packed the CSD07 of MQ. But it still raise this exception.
Do i need to recreate my queue managers after installing CSD07?
And, in the code, the creation of topic connection is hard coded.
Is there any differences between hard code and using JDNI lookup?

Thanks!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 28, 2004 1:27 pm    Post subject: Reply with quote

Grand High Poobah

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

Quote:
Is there any differences between hard code and using JNDI lookup?

A) JNDI lookup:
    1)objects exist in MQ
    2) the objects are wrapped and exposed to the programmer through JNDI
    3) The JMS programmer has no idea of the real objects name (MQ) as this is transparent to him.

If you are using JMS you need to use the JNDI lookup if information of the real object needs to stay hidden from the programming model

B) or if you do not use JNDI lookup:

    1) you need to know what the physical set up is ( transparent to JNDI)
    2) You need to use the MQJMS classes as they provide additionnal methods to set the info needed:
    MQTopicConnectionFactory
    3) You need to have the objects created in MQ before trying to use them
    4) use TopicSession.createTopic to access your Topic.
    I believe the implementation of the Topic is done through a queue. This queue must already exist in MQ to be able to create it using TopicSession.createTopic method.

Hope it helps some.
Back to top
View user's profile Send private message Send e-mail
garfiny
PostPosted: Wed Jul 28, 2004 7:08 pm    Post subject: Reply with quote

Novice

Joined: 23 Jul 2004
Posts: 19

Thanks fjb_saper and all, I've solved the problem.
I used JNDI instead of hard code. Everything is ok now.
I think my problem is that i didn't set the attributes for factory properly.

Thanks!
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 » Can not create topic connection
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.