Author |
Message
|
eosterm |
Posted: Sun Feb 19, 2006 10:38 pm Post subject: getLinkedException() doesn't provide enough info |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
Hi, all. I could use some help here.
I'm getting these errors:
MQJMS2008: failed to open MQ queue (this is the linked exception)
MQJMS3009: Failed to publish command to MQ queue
I can't get MQ to tell me what queue it can't open.
There are no errors in AMQERR01.LOG.
My topic is 'mdbTopic'. I can only guess it is trying to open
a Q associated with this topic. What do I need to do to verify
that I have the right stuff?
I get these errors when I register my MDB with my app server (contact admin).
It looks like they're coming from XATopicConnection createConnectionConsumer().
The topic name is 'topic://mdbTopic'
Whenever I do this, MQ shows lots of activity on SYSTEM.DEF.SVRCONN.
When I look at SYSTEM.DEF.SVRCONN in MQExplorer, there are 2 entries
for my client ip (55.555.55.55 below)
One entry shows a message count of 335 and the other line has 25.
dis chs(*)
1 : dis chs(*)
AMQ8417: Display Channel Status details.
CHANNEL(SYSTEM.DEF.SVRCONN) XMITQ( )
CONNAME(55.555.55.55) CURRENT
CHLTYPE(SVRCONN) STATUS(RUNNING)
RQMNAME( )
AMQ5555: Display Channel Status details.
CHANNEL(SYSTEM.DEF.SVRCONN) XMITQ( )
CONNAME(55.555.55.55) CURRENT
CHLTYPE(SVRCONN) STATUS(RUNNING)
RQMNAME( )
Thanks,
--Erik |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 2:37 am Post subject: |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
This is looking like a security error.
So, I'm doing what I should have done it the first place, which is test my client installation.
C:\Program Files\IBM\WebSphere MQ\Tools\Java\base\MQIVP.class
ran just fine.
However, when I run the test client like this:
amqsputc SYSTEM.DEFAULT.LOCAL.QUEUE QMDFWIN
I get this on the client:
Sample AMQSPUT0 start
MQCONN ended with reason code 2035
and the following in the server log:
AMQ8077: Entity 'myUser' has insufficient authority to access object
'QMDFWIN'.
EXPLANATION:
The specified entity is not authorized to access the required object. The
following requested permissions are unauthorized: connect
ACTION:
Ensure that the correct level of authority has been set for this entity against
the required object, or ensure that the entity is a member of a privileged
group.
I've added myUser on the server, and added him to the mqm group.
I did the 'REFRESH SECURITY' thingy.
What else do I need to do to veryify that I've got it right?
dspmqaut -m QMDFWIN -t qmgr -p myUser
Entity myUser has the following authorizations for object QMDFWIN:
inq
set
connect
altusr
crt
dlt
chg
dsp
setid
setall |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Feb 20, 2006 4:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You don't say what OS your QM is running on.
But "myUser" on Machine A is almost never the same as "myUser" on machine B. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 20, 2006 6:38 am Post subject: Re: getLinkedException() doesn't provide enough info |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
eosterm wrote: |
Hi, all. I could use some help here.
I'm getting these errors:
MQJMS2008: failed to open MQ queue (this is the linked exception)
MQJMS3009: Failed to publish command to MQ queue
Thanks,
--Erik |
Erik,
What you are displaying here is the JMSException and not the LinkedException. (Hint: MQJMSXXXX)
Note there is not always a LinkedException -- in that case it would be null.
Where the linked Exception is not null you need to extract it from the JMSException and display it. Usually it will contain the reason code (reason code = xxxx) which it appears should be 2035 here (according to your other test).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 6:58 am Post subject: |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
jefflowrey wrote: |
You don't say what OS your QM is running on.
|
WinXP
jefflowrey wrote: |
But "myUser" on Machine A is almost never the same as "myUser" on machine B. |
I agree, but darned if I know how to tell the difference. In our big corporate network, I can never tell whether I'm 'myUser' or 'domain\myUser'.
The log on the server showed me as plain 'myUser'.
I glanced at that bit in the manuals about having Win2k domain controllers on your network. How the @#^@ am I supposed to know? Other than a having a broken system, is there a different way to find out whether this applies to me? |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 7:06 am Post subject: Re: getLinkedException() doesn't provide enough info |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
fjb_saper wrote: |
What you are displaying here is the JMSException and not the LinkedException. (Hint: MQJMSXXXX)
|
If that is right, someone must be stuffing the wrong exception in the wrong place. I reformatted what I put in the post, but here is the code that produced this:
throw new EJBException("Linked Exception [" + je.getLinkedException() + "]. Cannot create connection consumer in bean " + dd.getEjbName() + " :", je);
Is there no way for it to tell what the name of the object that can't be opened? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 20, 2006 7:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Usually I've found out that having authorizations on the user is always a bad game (loose, loose).
Set up a group and give out the authorizations on the group. Make sure the process running MQ has the authority to query the group membership.
Do not embed groups. Whith that you should be fine.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 7:35 am Post subject: |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
When the MQ logs showed me as 'myUser' instead of 'domain\myUser', I thought my decision to add a 'myUser' on the local box was correct.
Wrong. To fix this, I went to the mqm group and added 'domain\myUser'. Here is the wrong way: go into the 'server\myUser' account and add 'mqm'.
--Erik |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 8:18 am Post subject: What objects are necessary to write to a topic? |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
Help me understand this:
My code is all about writing to a topic. Instead of throwing an error saying
'cannot find topic', I'm getting 'cannot find queue' error.
So, that says to me my jndi topic must somehow point to a queue, yes?
My JNDI topic points to 2 local quques, SYSTEM.JMS.D.SUBSCRIBER.QUEUE and
SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE, which both exist.
For grins, i created a queue named 'mdbTopic'. It behaves the same with
and without this queue.
Here is the output from my program:
Quote: |
ClientContainer.info : Starting client...
JMS client: tcf = com.ibm.mq.jms.MQTopicConnectionFactory@6f0ee4d3
JMS client: topic = topic://mdbTopic
JMS client: tc = com.ibm.mq.jms.MQTopicConnection@111a3a4
Linked exception: [com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2085]
javax.jms.JMSException: MQJMS2008: failed to open MQ queue
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:540)
at com.ibm.mq.jms.MQSession.createTPublisher(MQSession.java:4952)
at com.ibm.mq.jms.MQTopicSession.createPublisher(MQTopicSession.java:744)
at newsamplemdb.MdbClient.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.objectweb.contact admin.client.ClientContainer.invokeClient(ClientContainer.java:610)
at org.objectweb.contact admin.client.ClientContainer.start(ClientContainer.java:405)
at org.objectweb.contact admin.client.ClientContainer.main(ClientContainer.java:192)
Here is my code
Code: |
public class MdbClient {
static Context ictx = null;
static TopicConnectionFactory tcf = null;
static TopicPublisher tp = null;
static Topic topic = null;
// JNDI name of the Topic
static String topicName = "mdbTopic";
// JNDI name of the default connection factory
static String conFactName = "JTCF";
public static void main(String[] arg) {
// Get InitialContext
try {
// Creating an InitialContext.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:/c:/MqJmsJndiDir");
ictx = new InitialContext(env);
try {
Object o = ictx.lookup("wsmqXAQCF");
} catch(Exception e) {
System.out.println("couldn't find wsmqXAQCF");
e.printStackTrace();
}
//InitialContext myCtx = new InitialContext(env);
// lookup the TopicConnectionFactory through its JNDI name
tcf = (TopicConnectionFactory) ictx.lookup(conFactName );
System.out.println("JMS client: tcf = " + tcf);
// lookup the Topic through its JNDI name
topic = (Topic) ictx.lookup(topicName);
System.out.println("JMS client: topic = " + topic);
} catch (NamingException e) {
e.printStackTrace();
System.exit(2);
}
TopicConnection tc = null;
TopicSession session = null;
try {
tc = tcf.createTopicConnection();
System.out.println("JMS client: tc = " + tc.toString());
session = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
tp = session.createPublisher(topic);
}catch (JMSException je) {
System.out.println("Linked exception: [" + je.getLinkedException() + "]");
je.printStackTrace();
System.exit(2);
}catch (Exception e) {
e.printStackTrace();
System.exit(2);
}
// publish 10 messages to the topic
int nbmess = 10;
try {
TextMessage message;
for (int i=0;i<nbmess;i++){
message = session.createTextMessage();
message.setText("Message"+i);
tp.publish(message);
}
session.close();
/* temporary commented in order to avoid the blocking bug
of the Sun JDK 1.3 on Linux
tc.close();
*/
} catch (Exception e) {
e.printStackTrace();
System.exit(2);
}
System.out.println("MDBsample is Ok");
}
}
|
As seen at this link:
http://www.mqseries.net/phpBB2/viewtopic.php?p=99146&
I get the following in the server log whenever I execute this:
Quote: |
AMQ9208: Error on receive from host litlt0018740 (10.132.29.63).
EXPLANATION:
An error occurred receiving data from litlt0018740 (10.132.29.63) over TCP/IP.
This may be due to a communications failure.
ACTION:
The return code from the TCP/IP (recv) call was 10054 (X'2746'). Record these
values and tell the systems administrator.
|
Bless you all for hanging with me on this little adventure.
--Erik |
|
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 8:46 am Post subject: |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
Quote: |
My JNDI topic points to 2 local quques, SYSTEM.JMS.D.SUBSCRIBER.QUEUE and
SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE, which both exist.
|
I just tested these -- amqsputc successfully dumps data to both of these.
--Erik |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 20, 2006 9:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Try creating the topic before using it:
Code: |
Topic mytopic = Session.createTopic("topic:///mytopic"); |
_________________ MQ & Broker admin |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 10:20 am Post subject: |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
I tried your createTopic and I'm getting the sad same story.
The object you had be create was in lieu of my JNDI topic, right?
Why do you have 3 forward slashes in your code and my JMS object is formatting output (see above post) with 2:
Your code:
My JMS object output (from above):
I tried running your code with both 2 and 3 slashes -- no difference.
On a different note, this is interesting.
Everytime I run this client program, I get identically timestamped enties in the SYSTEM.JMS.PS.STATUS.QUEUE. MQEx says it is coming from WMQ client, too. Here is the data.
4D 51 4A 4D 53 5F 50 53 MQJMS_PS
5F 4A 56 4D 5F 53 54 41 _JVM_STA
54 55 53 5F 4D 53 47 62 TUS_MSGb
61 63 6B 6F 75 74 ackout
To me, this says
-data is getting to the server.
-this seems like a server configuration issue
I'm trying to use strmqtrc and endmqtrc.
I'm inserting some working puts, but can't find the trace output.
The admin guide says
Quote: |
the output file is created in the \<mqmwork>\trace directory, where <mqmwork> is the directory selected to hold WebSphere MQ data files.
|
What directory are they talking about?
I'm still trying to figure out what q it is trying o access.
Thanks,
--Erik |
|
Back to top |
|
 |
mvic |
Posted: Mon Feb 20, 2006 10:30 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
eosterm wrote: |
I'm trying to use strmqtrc and endmqtrc.
I'm inserting some working puts, but can't find the trace output.
The admin guide says
Quote: |
the output file is created in the \<mqmwork>\trace directory, where <mqmwork> is the directory selected to hold WebSphere MQ data files.
|
What directory are they talking about? |
For MQ 5.3 : C:\Program Files\IBM\WebSphere MQ\errors
For MQ 6.0 : C:\Program Files\IBM\WebSphere MQ\trace
EDIT: fixed typo |
|
Back to top |
|
 |
eosterm |
Posted: Mon Feb 20, 2006 12:08 pm Post subject: |
|
|
Novice
Joined: 09 Feb 2006 Posts: 24
|
I'm using a pub/sub example that came with contact admin. I thought I'd use that as a stepping stone to get to my real destination of point-to-point.
I read the dumps and figured out it was looking for
SYSTEM.BROKER.CONTROL.QUEUE
SYSTEM.BROKER.DEFAULT.STREAM
So why was MQ so incapable of telling me this in the first place?
Adding these 2 queues got me by that error and on to the next:
Quote: |
com.ibm.mq.jms.NoBrokerResponseException: MQJMS5053: *** No broker response. Please ensure that the
running. If you are using the WebSphere MQ broker check that your brokerVersion is set to V1 ***
|
Yikes. Would I really have to install MQ Event Broker to get a broker up and running for pub/sub?
Thanks,
--Erik |
|
Back to top |
|
 |
mvic |
Posted: Mon Feb 20, 2006 12:26 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
eosterm wrote: |
I read the dumps and figured out it was looking for
SYSTEM.BROKER.CONTROL.QUEUE
SYSTEM.BROKER.DEFAULT.STREAM
So why was MQ so incapable of telling me this in the first place? |
Did you run the necessary definitions into the queue manager thus:
Code: |
runmqsc QMNAME < "C:\Program Files\IBM\WebSphere MQ\Java\bin\MQJMS_PSQ.mqsc" |
|
|
Back to top |
|
 |
|