Announcement Announcement Module
Collapse
No announcement yet.
JMS MQSeries: unable to create MQConnectionManager Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS MQSeries: unable to create MQConnectionManager

    Hi,


    I'm trying to configure my standalone application in order to manipulate messages from/to MQSeries v6 without using JNDI nor EJB.
    I am using Spring 2.5.6.

    I'm getting the error "Unknown Host" :

    Code:
    10 juil. 2009 13:41:58 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@ec16a4: display name [org.springframework.context.support.ClassPathXmlApplicationContext@ec16a4]; startup date [Fri Jul 10 13:41:58 CEST 2009]; root of context hierarchy
    10 juil. 2009 13:41:58 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
    10 juil. 2009 13:41:58 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@ec16a4]: org.springframework.beans.factory.support.DefaultListableBeanFactory@a8c488
    10 juil. 2009 13:41:58 org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
    INFO: Loading properties file from class path resource [MQResources.properties]
    10 juil. 2009 13:41:58 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@a8c488: defining beans [propertyConfigurer,jmsFactory,jmsQueue,jmsTemplate,jmsReceiver,jmsSender,jmsService]; root of factory hierarchy
    Exception in thread "main" org.springframework.jms.UncategorizedJmsException: Uncategorized exception occured during JMS processing; nested exception is javax.jms.JMSException: MQJMS2005: Impossible de créer MQQueueManager pour 'nomDeMonHost
    					:queueManager'; nested exception is com.ibm.mq.MQException: MQJE001 : MQException : Code achèvement 2, raison 2059
    MQJE010 : Hôte inconnu : nomDeMonHost
    					
    	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:539)
    	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:617)
    	at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:609)
    	at org.home.test.JmsSender.sendMesage(JmsSender.java:17)
    	at org.home.test.JmsServiceImpl.process(JmsServiceImpl.java:26)
    	at org.home.test.App.main(App.java:14)
    Caused by: javax.jms.JMSException: MQJMS2005: Impossible de créer MQQueueManager pour 'nomDeMonHost
    					:queueManager'
    	at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:586)
    	at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2082)
    	at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1496)
    	at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:150)
    	at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:185)
    	at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:112)
    	at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:1050)
    	at org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:343)
    	at org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:290)
    	at org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:227)
    	at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
    	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:461)
    	... 6 more
    My config file is this one:

    Code:
    <!-- ConnectionFactory -->
    	<bean id="jmsFactory"
    		class="org.springframework.jms.connection.SingleConnectionFactory">
    		<property name="targetConnectionFactory">
    			<bean class="com.ibm.mq.jms.MQQueueConnectionFactory">
    				<property name="hostName">
    					<value>nomDeMonHost
    					</value>
    				</property>
    				<property name="port">
    					<value>numPort</value>
    				</property>
    				<property name="queueManager">
    					<value>queueManager</value>
    				</property>
    				<property name="channel">
    					<value>channel</value>
    				</property>				
    				<property name="transportType">
    					<value>1</value>
    				</property>
    			</bean>
    
    		</property>
    	</bean>
    
    	<bean id="jmsQueue" class="com.ibm.mq.jms.MQQueue">
    		<property name="baseQueueName">
    			<value>nomQueue
    			</value>
    		</property>
    	</bean>
    
    	<!-- template -->
    	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    		<property name="connectionFactory">
    			<ref bean="jmsFactory" />
    		</property>
    		<property name="defaultDestination" ref="jmsQueue"></property>
    	</bean>
    
    	<!-- Receiver -->
    	<bean id="jmsReceiver" class="org.home.test.JmsReceiver">
    		<property name="jmsTemplate">
    			<ref bean="jmsTemplate" />
    		</property>
    	</bean>
    
    	<!-- Sender -->
    	<bean id="jmsSender" class="org.home.test.JmsSender">
    		<property name="jmsTemplate">
    			<ref bean="jmsTemplate" />
    		</property>
    	</bean>
    
    
    	<bean id="jmsService" class="org.home.test..JmsServiceImpl">
    		<property name="sender">
    			<ref bean="jmsSender" />
    		</property>
    		<property name="receiver">
    			<ref bean="jmsReceiver" />
    		</property>
    	</bean>
    Since i made some search i have checked i am using the right jms and ibm jars (for the v6 version of MQ)
    I tested also my queue with a simple test case of sending/receiving message without Spring configuation in the same project (same parameters and same jars)
    and it is OK !!

    I am new user of Spring.Is there any problem with my configuration?
    Have someone an exemple of configuration that worked fine for him?
    Someone have any idea?

    Big thanks !

  • #2
    JMS MQSeries unable to create MQConnectionManager

    Can an MQ Base Java standard MQMD header message sent to an MQSeries Queue be read by a program that uses the MQSeries JMS Java classes?

    thanks,

    Comment

    Working...
    X