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 » MQJMS2008

Post new topic  Reply to topic
 MQJMS2008 « View previous topic :: View next topic » 
Author Message
Blomman
PostPosted: Tue Dec 02, 2008 8:19 am    Post subject: MQJMS2008 Reply with quote

Master

Joined: 31 Oct 2006
Posts: 230

Hi!

Im getting this exception while trying to do a TopicConnection..

Code:

Exception in thread "main" javax.jms.JMSException: MQJMS2008: failed to open MQ queue
 at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
 at com.ibm.mq.jms.MQBrokerSubscriptionEngine.sendBrokerMessageInternal(MQBrokerSubscriptionEngine.java:2557)
 at com.ibm.mq.jms.MQBrokerSubscriptionEngine.setDeferredMessage(MQBrokerSubscriptionEngine.java:2900)
 at com.ibm.mq.jms.MQBrokerSubscriptionEngine.openDurableSubscription(MQBrokerSubscriptionEngine.java:816)
 at com.ibm.mq.jms.MQMigrateSubscriptionEngine.openDurableSubscription(MQMigrateSubscriptionEngine.java:544)
 at com.ibm.mq.jms.MQSession.createDurableSubscriber(MQSession.java:5338)
 at com.ibm.mq.jms.MQTopicSession.createDurableSubscriber(MQTopicSession.java:720)
 at com.ibm.mq.jms.MQSession.createDurableSubscriber(MQSession.java:5163)
 at com.ibm.mq.jms.MQTopicSession.createDurableSubscriber(MQTopicSession.java:706)
 at default_package.PubSub.main(PubSub.java:39)



My MQ log:
Code:

12/02/2008 05:27:57 PM - Process(13227.130) User(mqm) Program(amqrmppa)
AMQ9208: Error on receive from host 172 ("myIp").
 
EXPLANATION:
An error occurred receiving data from 172 ("myIp") over TCP/IP. This may
be due to a communications failure.
ACTION:
The return code from the TCP/IP (read) call was 104 (X'68'). Record these
values and tell the systems administrator.


This is my code, what have i missed?
I Suspect this is an MQ security issue? How to get the reason code from mq linked to this exception??

Code:


/Author Michael Blomberg
 
package default_package;
import javax.jms.JMSException;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicSession;
import javax.jms.TopicSubscriber;
import com.ibm.mq.jms.*;
import com.ibm.mq.*;
 
public class PubSub {
 
 public static void main(String[] args) throws JMSException
 {
 MQTopicConnectionFactory factory = new MQTopicConnectionFactory();
 factory.setBrokerControlQueue("SYSTEM.BROKER.CONTROL.QUEUE");
 factory.setBrokerQueueManager("WBRK6_DEFAULT_QUEUE_MANAGER");
 factory.setBrokerSubQueue("JMS.PUB.SUB");
 //factory.setBrokerPubQueue(arg0)
 //factory.setChannel("SOME.CHANNEL");
 factory.setHostName("hostname");
 factory.setPort(2414);
 factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP); // After using this type of connection i got TopicConnection
 
 
 TopicConnection topicConnection = factory.createTopicConnection();
 topicConnection.setClientID("1"); // Necessary when using durable subscribers unique id needs to be defined
 topicConnection.start();
 
 TopicSession topicSession = (TopicSession) topicConnection.createSession(false,TopicSession.AUTO_ACKNOWLEDGE);
 Topic topic = topicSession.createTopic("$SYS/Broker/WBRK6_DEFAULT_BROKER/StatisticsAccounting/Snapshot/default/#");
 
 //topicSession.createPublisher(topic);
 //topicSession.createQueue("topicq");
 //topicSession.run();
 
 TopicSubscriber topicSubscriber = topicSession.createDurableSubscriber(topic,"Message Flow Statistics Subscriber");
 
 TextMessage msg = (TextMessage)topicSubscriber.receive();
 System.out.println(msg.getText());
 
 }
}



Regards!

//Michael


Last edited by Blomman on Tue Dec 02, 2008 8:30 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 02, 2008 8:29 am    Post subject: Re: MQJMS2008 Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Blomman wrote:
This is my code, what have i missed?


Possibly nothing, if it's a 2035 or similar

Blomman wrote:
I Suspect this is an MQ security issue?


Then why ask about your code?

Blomman wrote:
How to get the reason code from mq linked to this exception??


Mr Google suggests something like:

Code:
 linked=e.getLinkedException


in your catch block where e is the original exception.

Unlike you, I'm not a Java person so I suggest you ask him directly for a clearer explaination.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
SAFraser
PostPosted: Tue Dec 02, 2008 9:49 am    Post subject: Reply with quote

Shaman

Joined: 22 Oct 2003
Posts: 742
Location: Austin, Texas, USA

You can add a snippet to get an MQ reason code... Is this what you are looking for?

http://www.mqseries.net/phpBB2/viewtopic.php?t=42149
Back to top
View user's profile Send private message
Blomman
PostPosted: Tue Dec 02, 2008 12:24 pm    Post subject: Reply with quote

Master

Joined: 31 Oct 2006
Posts: 230

SAFraser wrote:
You can add a snippet to get an MQ reason code... Is this what you are looking for?

http://www.mqseries.net/phpBB2/viewtopic.php?t=42149


Yes that is what im looking for but the link in that topic is DEAD.

//Micke
Back to top
View user's profile Send private message
SAFraser
PostPosted: Tue Dec 02, 2008 12:40 pm    Post subject: Reply with quote

Shaman

Joined: 22 Oct 2003
Posts: 742
Location: Austin, Texas, USA

Sorry, I'll see if I can find a working link and post it.

Here, though, is the snippet as I understand it:

try {
.
. code which may throw a JMSException
.
} catch (JMSException je) {
System.err.println("caught "+je);
Exception e = je.getLinkedException();
if (e != null) {
System.err.println("linked exception: "+e);
}
}
Back to top
View user's profile Send private message
Blomman
PostPosted: Tue Dec 02, 2008 1:07 pm    Post subject: Re: MQJMS2008 Reply with quote

Master

Joined: 31 Oct 2006
Posts: 230

Vitor wrote:
Blomman wrote:
This is my code, what have i missed?


Possibly nothing, if it's a 2035 or similar

Blomman wrote:
I Suspect this is an MQ security issue?


Then why ask about your code?

Blomman wrote:
How to get the reason code from mq linked to this exception??


Mr Google suggests something like:

Code:
 linked=e.getLinkedException


in your catch block where e is the original exception.

Unlike you, I'm not a Java person so I suggest you ask him directly for a clearer explaination.


"Then why ask about your code? "

Cause i maybe had missed something in my code to set for example MCAUSER or simular...I asked becuse i dont know..
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Dec 02, 2008 3:08 pm    Post subject: Re: MQJMS2008 Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Blomman wrote:
Cause i maybe had missed something in my code to set for example MCAUSER or simular...I asked becuse i dont know..


You can't set MCAUser in code.

Indeed it's tricky for an application to deal with security issues.

I suppose it would be an odd situation if an app got a 2035 security error, and was able to deal with it by reseting the security on the system. Take all the fun out hacking for one thing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Blomman
PostPosted: Tue Dec 02, 2008 10:44 pm    Post subject: Re: MQJMS2008 Reply with quote

Master

Joined: 31 Oct 2006
Posts: 230

Vitor wrote:
Blomman wrote:
Cause i maybe had missed something in my code to set for example MCAUSER or simular...I asked becuse i dont know..


You can't set MCAUser in code.

Indeed it's tricky for an application to deal with security issues.


I suspected that, perhaps its better to look into som SSL for authentication issues, but now i will look into solving this issue.
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 » MQJMS2008
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.