Author |
Message
|
Blomman |
Posted: Tue Dec 02, 2008 8:19 am Post subject: MQJMS2008 |
|
|
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 |
|
 |
Vitor |
Posted: Tue Dec 02, 2008 8:29 am Post subject: Re: MQJMS2008 |
|
|
 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 |
|
 |
SAFraser |
Posted: Tue Dec 02, 2008 9:49 am Post subject: |
|
|
 Shaman
Joined: 22 Oct 2003 Posts: 742 Location: Austin, Texas, USA
|
|
Back to top |
|
 |
Blomman |
Posted: Tue Dec 02, 2008 12:24 pm Post subject: |
|
|
Master
Joined: 31 Oct 2006 Posts: 230
|
Yes that is what im looking for but the link in that topic is DEAD.
//Micke |
|
Back to top |
|
 |
SAFraser |
Posted: Tue Dec 02, 2008 12:40 pm Post subject: |
|
|
 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 |
|
 |
Blomman |
Posted: Tue Dec 02, 2008 1:07 pm Post subject: Re: MQJMS2008 |
|
|
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 |
|
 |
Vitor |
Posted: Tue Dec 02, 2008 3:08 pm Post subject: Re: MQJMS2008 |
|
|
 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 |
|
 |
Blomman |
Posted: Tue Dec 02, 2008 10:44 pm Post subject: Re: MQJMS2008 |
|
|
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 |
|
 |
|