|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQJE016: MQ queue manager closed channel immediately |
« View previous topic :: View next topic » |
Author |
Message
|
m.krebber |
Posted: Wed Jan 21, 2009 3:06 am Post subject: MQJE016: MQ queue manager closed channel immediately |
|
|
Newbie
Joined: 21 Jan 2009 Posts: 3
|
Hello, im new to this forum and to the MQ server V6.0. Im trying to connect from a client using regular JMS to a remote MQ server and get the exception:
Quote: |
MQJE016: MQ queue manager closed channel immediately during connect. Closure reason = 2009 |
now i have tried some paths and samples already, including 1) the updates in ms0b and me01 for an MQ client and 2) using a bindings jndi with spring. both of them with above exception. so i have come to the conclusion that the MQ server configuration of the queues is the problem. For illustration here is the steps i did for spring using a .bindings file:
1. spring configuration (taken from an IBM sample)
=================================
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "....>
<!-- Application Context -->
<beans>
<!-- JNDI Environment Template -->
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</prop>
<prop key="java.naming.provider.url">file:/D:/JNDI-Directory</prop>
</props>
</property>
</bean>
<!-- JMS Queue Connection Factory -->
<bean id="internalJmsQueueConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate"/>
</property>
<property name="jndiName">
<value>MQ_JMS_MANAGER</value>
</property>
</bean>
<!-- Spring JMS Queue Connection Factory -->
<bean id="jmsQueueConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory102">
<property name="targetConnectionFactory">
<ref bean="internalJmsQueueConnectionFactory"/>
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
</bean>
<!-- JMS Destination Resolver -->
<bean id="jmsDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver">
<property name="jndiTemplate">
<ref bean="jndiTemplate"/>
</property>
<property name="cache">
<value>true</value>
</property>
</bean>
<!-- JMS Queue Template -->
<bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate102">
<property name="connectionFactory">
<ref bean="jmsQueueConnectionFactory"/>
</property>
<property name="destinationResolver">
<ref bean="jmsDestinationResolver"/>
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
<property name="receiveTimeout">
<value>20000</value>
</property>
</bean>
<bean id="jmsSender" class="springexample.client.JMSSender">
<property name="jmsTemplate102">
<ref bean="jmsQueueTemplate"/>
</property>
</bean>
<bean id="jmsReceiver" class="springexample.client.JMSReceiver">
<property name="jmsTemplate102">
<ref bean="jmsQueueTemplate"/>
</property>
</bean>
</beans>
|
so, there is nothing MQ specific in the definition of the beans.
2. next i created a queue manager (MY.Q.MGR), a local queue(MY.Q) and a channel(MY.CHANNEL.SVR) of type server connection using the standard MQ browser V6.0. I started the tcp listener for the manager as suggested elsewhere. Assume this server is running on 1.1.1.1:1414.
3. I used JMSAdmin.bat for generating the .bindings file on my local pc, updatinmg the config file with:
Code: |
...
#INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
#INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
#
# The following line specifies the URL of the service provider's initial
# context. It currently refers to an LDAP root context. Examples of a
# file system URL and WebSphere's JNDI namespace are also shown, commented
# out.
#
#PROVIDER_URL=ldap://polaris/o=ibm,c=us
PROVIDER_URL=file:/D:/JNDI-Directory
#PROVIDER_URL=iiop://localhost/
#
# The following line specifies the security authentication model in use,
# and may be 'none' (for anonymous authentication), 'simple', or 'CRAM_MD5'.
#
SECURITY_AUTHENTICATION=none
#
...
|
4. started JMSAdmion locally and entered the commands:
Quote: |
def qcf(MQ_JMS_MANAGER) qmgr(MY.Q.MGR) tran(client) chan(MY.CHANNEL.SVR) host(1.1.1.1) port(1414)
def q(JMS_RequestResponseQueue) qmgr(MY.Q.MGR) queue(MY.Q)
end
|
this generates a .bindings file on my local pc, which is again used by the connection bean
5. i started the test program which just instantiates the spring beans and attempts a connection with the MQ manager:
Code: |
public static void main(String[] args){
try
{
System.out.println("SendMQSpringJMS started");
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(new String[] {
"spring-mqseries-jms.xml"
});
System.out.println("Classpath loaded");
JMSSender jmsSender = (JMSSender)
appContext.getBean("jmsSender");
jmsSender.sendMesage();
...
|
the above brings the exception
21.01.2009 10:36:34 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@145d068]: org.springframework.beans.factory.support.DefaultListableBeanFactory@18e2b22
21.01.2009 10:36:34 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@18e2b22: defining beans [jndiTemplate,internalJmsQueueConnectionFactory,jmsQueueConnectionFactory,jmsDestinationResolver,jmsQueueTemplate,jmsSender,jmsReceiver]; root of factory hierarchy
Classpath loaded
org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: MQJMS2005: Error creating MQQueueManager für '1.1.1.1:MY.Q.MGR'; nested exception is com.ibm.mq.MQException: MQJE001: MQException: Closure reason 2, Ursache 2009
MQJE016: MQ queue manager closed channel immediately during connect. Closure reason = 2009
Ursache = 2009
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:308)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:548)
at springexample.client.JMSSender.sendMesage(JMSSender.java:33)
at springexample.client.SendMQSpringJMS.main(SendMQSpringJMS.java:29)
Caused by: javax.jms.JMSException: MQJMS2005: Fehler beim Erstellen von MQQueueManager für '10.73.3.108:FDT.Q.MGR'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:644)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2567)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1912)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:161)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:202)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:121)
at org.springframework.jms.connection.SingleConnectionFactory102.doCreateConnection(SingleConnectionFactory102.java:125)
at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:290)
at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:227)
at org.springframework.jms.connection.SingleConnectionFactory.createQueueConnection(SingleConnectionFactory.java:242)
at org.springframework.jms.core.JmsTemplate102.createConnection(JmsTemplate102.java:170)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461)
... 3 more
any help what the problem might be will be greatly appreciated!!
marcelo |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 21, 2009 3:23 am Post subject: Re: MQJE016: MQ queue manager closed channel immediately |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
m.krebber wrote: |
any help what the problem might be will be greatly appreciated!! |
First let me say this is the best post I've seen on here for a while! You are to be congratulated for the quality of the information you've provided and the details of the steps you've taken!
Second let me say my Java is probably insufficient to be much help!
I would recommend you do the following:
- make sure you can telnet from where you're running the Java to the port on the queue manager
- check for channel errors in the queue manager log
- make sure the user id running the Java has the relevant permissions with the queue manager
- search the forum for other posts on 2009 errors (they're quite common)
- wait for one of my more Java-literate associates to comment  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 21, 2009 4:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
MQJE016: MQ queue manager closed channel immediately during connect. Closure reason = 2009
now i have tried some paths and samples already, including 1) the updates in ms0b and me01 for an MQ client and 2) using a bindings jndi with spring. both of them with above exception. so i have come to the conclusion that the MQ server configuration of the queues is the problem. For illustration here is the steps i did for spring using a .bindings file: |
Not so sure about your analysis there. 2009 indicates a communication problem.
Have you tried
Code: |
telnet <mqserver> 1414 |
and did that succeed?
Quote: |
def qcf(MQ_JMS_MANAGER) qmgr(MY.Q.MGR) tran(client) chan(MY.CHANNEL.SVR) host(1.1.1.1) port(1414) |
If you are doing request reply or using dynamic temporary queues you should at least have also specified the MODEL queue name to be used to create the temporary dynamic queues as well as the default prefix like
"WEB.TEMP.*" So your qcf definition might be incomplete for the usage you need to put it to...
Now you need to also verify exactly the qmgr name and the connection parameters. I prefer to use a hostname over the actual IP because with a little luck the host name is unique whereas the IP might change depending on where you initiate the call from: think NAT (network something traversal)...
This being said I expect you'll find a firewall or some communications problem preventing you from accessing the MQServer.
As well do you have an MCAUser defined on MY.CHANNEL.SVR?
Do you need to access it with a user other than mqm?
Have you used the alternate connect form like defining a JAAS alias to use on the connection?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
m.krebber |
Posted: Wed Jan 21, 2009 8:21 am Post subject: |
|
|
Newbie
Joined: 21 Jan 2009 Posts: 3
|
fjb_saper wrote: |
Not so sure about your analysis there. 2009 indicates a communication problem.
Have you tried
Code: |
telnet <mqserver> 1414 |
and did that succeed?
Quote: |
def qcf(MQ_JMS_MANAGER) qmgr(MY.Q.MGR) tran(client) chan(MY.CHANNEL.SVR) host(1.1.1.1) port(1414) |
If you are doing request reply or using dynamic temporary queues you should at least have also specified the MODEL queue name to be used to create the temporary dynamic queues as well as the default prefix like
"WEB.TEMP.*" So your qcf definition might be incomplete for the usage you need to put it to...
Now you need to also verify exactly the qmgr name and the connection parameters. I prefer to use a hostname over the actual IP because with a little luck the host name is unique whereas the IP might change depending on where you initiate the call from: think NAT (network something traversal)...
This being said I expect you'll find a firewall or some communications problem preventing you from accessing the MQServer.
As well do you have an MCAUser defined on MY.CHANNEL.SVR?
Do you need to access it with a user other than mqm?
Have you used the alternate connect form like defining a JAAS alias to use on the connection?  |
thanks so much for the tips. These lead me definetely to the solution - and it works now! what i have done is:
1. telnet to my MQ and realized it was not responding for some reason. so i just assigned to MY.Q.MGR a new TCP port, here 1415 and started it using MQ browser.
2. i used host name here MYMQHOST for the connection , instead of the IP.
that allowed to get rid of the 2009 error and MQ responded with asecurity exception. i assigned here (after looking into another post) user= " " and password " " (with blanks) for the security. using spring it now looks like:
3.
Code: |
<!-- provide default MQ user and password -->
<bean id="internalSecuredJmsQueueConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="internalJmsQueueConnectionFactory"/>
<property name="username" value=" "/>
<property name="password" value=" "/>
</bean>
<!-- Spring JMS Queue Connection Factory -->
<bean id="jmsQueueConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory102">
<property name="targetConnectionFactory">
<!--<ref bean="internalJmsQueueConnectionFactory"/>-->
<ref bean="internalSecuredJmsQueueConnectionFactory"/>
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
</bean>
|
the other beans remained unchanged.
4. i generated the .binding file again using JMSADmin with
Quote: |
def qcf(MQ_JMS_MANAGER) qmgr(MY.Q.MGR) tran(client) chan(SYSTEM.DEF.SVRCONN) host(MYMQHOST) port(1415)
def q(JMS_RequestResponseQueue) qmgr(MY.Q.MGR) queue(MY.Q)
|
that brought the so awaited success for sending messages!! for receiving over the same queue i still had to set the que properties of MY.Q ov to "allow to receive" messages using MQ browser.
Thanks for to all for the prompt support!!
marcelo |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 21, 2009 8:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Well done you, and thank you for posting the solution.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|