activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phoenixdragon <liem.le...@googlemail.com>
Subject Re: AMQ5.1 bridge to WebsphereMQ 5.3 -> javax.jms.IllegalStateException: MQJMS1112
Date Wed, 21 Oct 2009 17:41:13 GMT

Hi,

I tried the camel example Xquery and modified camelcontext.xml

    <route>
      <from uri="jms:MyQueue"/>
      <to uri="file:target/outputFiles"/>
      <to uri="webspheremq:queue:Q1"/> 

    </route>

  </camelContext>
  <!-- lets configure the default ActiveMQ broker URL -->
  <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL"
value="vm://localhost?broker.persistent=false"/>
      </bean>
    </property>
  </bean>
 <bean id="webspheremq" class="org.apache.camel.component.jms.JmsComponent"> 
    <property name="connectionFactory"> 
    <bean
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> 
      <property name="targetConnectionFactory"> 
      <bean class="com.ibm.mq.jms.MQQueueConnectionFactory"> 
	<property name="transportType" value="1"/> 
	<property name="hostName" value="192.168.0.4"/> 
	<property name="port" value="1414"/> 
	<property name="queueManager" value="QM_APPLE"/> 
	<property name="channel" value="QM_ORANGE.QM_APPLE"/> 
      </bean> 
      </property> 
        <property name="username" value="liem.leong"/> 
        <property name="password" value="apple1"/> 
    </bean> 
    </property> 
</bean> 

and added the following to Camel Routes.dot and Routes.dot


node5 [
label = "webspheremq:queue:Q1"
tooltip = "webspheremq:queue:Q1"
URL = "http://camel.apache.org/message-endpoint.html"
];

node4 -> node5 [
];

and I got the following error, what have I done wrong?

     [java] [                          main] MainSupport                   
ERRO
R Failed: org.springframework.beans.factory.BeanCreationException: Error
creatin
g bean with name 'webspheremq' defined in file
[C:\apache-camel-2.0-M2\examples\
camel-example-spring-xquery\target\classes\META-INF\spring\camelContext.xml]:
Ca
nnot create inner bean
'org.springframework.jms.connection.UserCredentialsConnec
tionFactoryAdapter#2d189c' of type
[org.springframework.jms.connection.UserCrede
ntialsConnectionFactoryAdapter] while setting bean property
'connectionFactory';
 nested exception is
org.springframework.beans.factory.BeanCreationException: Er
ror creating bean with name
'org.springframework.jms.connection.UserCredentialsC
onnectionFactoryAdapter#2d189c' defined in file
[C:\apache-camel-2.0-M2\examples
\camel-example-spring-xquery\target\classes\META-INF\spring\camelContext.xml]:
C
annot create inner bean 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d' of
type
 [com.ibm.mq.jms.MQQueueConnectionFactory] while setting bean property
'targetCo
nnectionFactory'; nested exception is
org.springframework.beans.factory.CannotLo
adBeanClassException: Cannot find class
[com.ibm.mq.jms.MQQueueConnectionFactory
] for bean with name 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d'
defined in
 file
[C:\apache-camel-2.0-M2\examples\camel-example-spring-xquery\target\classe
s\META-INF\spring\camelContext.xml]; nested exception is
java.lang.ClassNotFound
Exception: com.ibm.mq.jms.MQQueueConnectionFactory
     [java] org.springframework.beans.factory.BeanCreationException: Error
creat
ing bean with name 'webspheremq' defined in file
[C:\apache-camel-2.0-M2\example
s\camel-example-spring-xquery\target\classes\META-INF\spring\camelContext.xml]:
Cannot create inner bean
'org.springframework.jms.connection.UserCredentialsConn
ectionFactoryAdapter#2d189c' of type
[org.springframework.jms.connection.UserCre
dentialsConnectionFactoryAdapter] while setting bean property
'connectionFactory
'; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.jms.connection.UserCredential
sConnectionFactoryAdapter#2d189c' defined in file
[C:\apache-camel-2.0-M2\exampl
es\camel-example-spring-xquery\target\classes\META-INF\spring\camelContext.xml]:
 Cannot create inner bean 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d'
of ty
pe [com.ibm.mq.jms.MQQueueConnectionFactory] while setting bean property
'target
ConnectionFactory'; nested exception is
org.springframework.beans.factory.Cannot
LoadBeanClassException: Cannot find class
[com.ibm.mq.jms.MQQueueConnectionFacto
ry] for bean with name 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d'
defined
in file
[C:\apache-camel-2.0-M2\examples\camel-example-spring-xquery\target\clas
ses\META-INF\spring\camelContext.xml]; nested exception is
java.lang.ClassNotFou
ndException: com.ibm.mq.jms.MQQueueConnectionFactory
     [java]     at
org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
     [java]     at
org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245
)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
$1.getObject(AbstractBeanFactory.java:264)
     [java]     at
org.springframework.beans.factory.support.DefaultSingletonBea
nRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
.doGetBean(AbstractBeanFactory.java:261)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:185)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:164)
     [java]     at
org.springframework.beans.factory.support.DefaultListableBean
Factory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
     [java]     at
org.springframework.context.support.AbstractApplicationContex
t.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
     [java]     at
org.springframework.context.support.AbstractApplicationContex
t.refresh(AbstractApplicationContext.java:380)
     [java]     at
org.springframework.context.support.ClassPathXmlApplicationCo
ntext.<init>(ClassPathXmlApplicationContext.java:139)
     [java]     at
org.springframework.context.support.ClassPathXmlApplicationCo
ntext.<init>(ClassPathXmlApplicationContext.java:93)
     [java]     at
org.apache.camel.spring.Main.createDefaultApplicationContext(
Main.java:231)
     [java]     at org.apache.camel.spring.Main.doStart(Main.java:185)
     [java]     at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.jav
a:52)
     [java]     at
org.apache.camel.impl.MainSupport.run(MainSupport.java:120)
     [java]     at
org.apache.camel.impl.MainSupport.run(MainSupport.java:298)
     [java]     at org.apache.camel.spring.Main.main(Main.java:97)
     [java] Caused by:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'org.springframework.jms.connection.UserCredential
sConnectionFactoryAdapter#2d189c' defined in file
[C:\apache-camel-2.0-M2\exampl
es\camel-example-spring-xquery\target\classes\META-INF\spring\camelContext.xml]:
 Cannot create inner bean 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d'
of ty
pe [com.ibm.mq.jms.MQQueueConnectionFactory] while setting bean property
'target
ConnectionFactory'; nested exception is
org.springframework.beans.factory.Cannot
LoadBeanClassException: Cannot find class
[com.ibm.mq.jms.MQQueueConnectionFacto
ry] for bean with name 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d'
defined
in file
[C:\apache-camel-2.0-M2\examples\camel-example-spring-xquery\target\clas
ses\META-INF\spring\camelContext.xml]; nested exception is
java.lang.ClassNotFou
ndException: com.ibm.mq.jms.MQQueueConnectionFactory
     [java]     at
org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
     [java]     at
org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245
)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at
org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
     [java]     ... 23 more
     [java] Caused by:
org.springframework.beans.factory.CannotLoadBeanClassExce
ption: Cannot find class [com.ibm.mq.jms.MQQueueConnectionFactory] for bean
with
 name 'com.ibm.mq.jms.MQQueueConnectionFactory#7e8c4d' defined in file
[C:\apach
e-camel-2.0-M2\examples\camel-example-spring-xquery\target\classes\META-INF\spri
ng\camelContext.xml]; nested exception is java.lang.ClassNotFoundException:
com.
ibm.mq.jms.MQQueueConnectionFactory
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
.resolveBeanClass(AbstractBeanFactory.java:1141)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
.resolveBeanClass(AbstractBeanFactory.java:1105)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:386)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
     [java]     at
org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
     [java]     ... 31 more
     [java] Caused by: java.lang.ClassNotFoundException:
com.ibm.mq.jms.MQQueueC
onnectionFactory
     [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     [java]     at java.security.AccessController.doPrivileged(Native
Method)
     [java]     at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
     [java]     at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

     [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
     [java]     at
org.springframework.util.ClassUtils.forName(ClassUtils.java:2
11)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanDefinit
ion.resolveBeanClass(AbstractBeanDefinition.java:385)
     [java]     at
org.springframework.beans.factory.support.AbstractBeanFactory
.resolveBeanClass(AbstractBeanFactory.java:1138)
     [java]     ... 36 more
     [java] [                      Thread-1] Main$HangupInterceptor        
INFO
  Recieved hang up - stopping the main instance.


martyman wrote:
> 
> Just in case someone is facing a similar problem. Here's my solution:
> 
> The following works for me:
> 
>  <bean id="webspheremq"
> class="org.apache.camel.component.jms.JmsComponent">
>     <property name="connectionFactory">
>     <bean
> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
>       <property name="targetConnectionFactory">
>       <bean class="com.ibm.mq.jms.MQQueueConnectionFactory">
>         <property name="hostName" value="Test"/>
>         <property name="port" value="1414"/>
>         <property name="queueManager" value="CSQ"/>
>         <property name="channel" value="CO.TEST"/>
>         <property name="transportType" value="1"/>
>       </bean>
>       </property>
>       <property name="username" value="xxxxxx"/>
>       <property name="password" value="xxxxxx"/>
>     </bean>
> 	</property>
> </bean>
> 
> Cheers,
>  Martin
> 
> 
> 
> martyman wrote:
>> 
>> Hi guys,
>> 
>> based on examples I've found on the net I've configured a bridge from AMQ
>> 5.1.0 to Webphere MQ 5.3. Messages are forwarded thus the bridge seems to
>> work but I get lots of javax.jms.IllegalStateExceptions in the logs (see
>> below).
>> 
>> Did I miss something? Any hints? 
>> 
>> Should I rather use Camel JMS Components?
>> 
>> Thanks,
>>  Martin
>> 
>> 
>> 
>> Relevant activemq.xml fragments:
>> ...
>> <jmsBridgeConnectors>
>>  <jmsQueueConnector name="activemq2webspheremq"
>> outboundQueueConnectionFactory="#remoteFactory">
>>   <outboundQueueBridges>
>> 	 <outboundQueueBridge outboundQueueName="WIN.TEST"
>> localQueueName="bridge2mq"/>
>>   </outboundQueueBridges>
>>    </jmsQueueConnector>
>> </jmsBridgeConnectors>
>> ...
>> <bean id="remoteFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
>>  <property name="transportType" value="1"/>
>>  <property name="hostName" value="Test"/>
>>  <property name="port" value="1414"/>
>>  <property name="queueManager" value="CSQ"/>
>>  <property name="channel" value="CO.TEST"/>
>> </bean> 
>> ....
>> 
>> 
>> 
>> 
>> 2008-05-13 09:13:50,445 [enerContainer-1] ERROR
>> efaultMessageListenerContainer - Setup of JMS message listener invoker
>> failed - trying to recover
>> javax.jms.IllegalStateException: MQJMS1112: JMS1.1 Ungültige Operation
>> für domänenspezifisches Objekt
>> 	at com.ibm.mq.jms.MQQueueSession.createTopic(MQQueueSession.java:734)
>> 	at
>> org.springframework.jms.support.destination.DynamicDestinationResolver.resolveTopic(DynamicDestinationResolver.java:86)
>> 	at
>> org.springframework.jms.support.destination.DynamicDestinationResolver.resolveDestinationName(DynamicDestinationResolver.java:63)
>> 	at
>> org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:100)
>> 	at
>> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:215)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:903)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:886)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
>> 	at java.lang.Thread.run(Unknown Source)
>> 2008-05-13 09:13:50,445 [enerContainer-1] INFO 
>> efaultMessageListenerContainer - Successfully refreshed JMS Connection
>> 2008-05-13 09:13:50,492 [enerContainer-1] ERROR
>> efaultMessageListenerContainer - Setup of JMS message listener invoker
>> failed - trying to recover
>> javax.jms.InvalidDestinationException: MQJMS2008: Fehler beim Öffnen der
>> MQ-Warteschlange 
>> 	at
>> com.ibm.mq.jms.MQQueueServices.getQueueOpenException(MQQueueServices.java:408)
>> 	at
>> com.ibm.mq.jms.JMSServicesMgr.getQueueOpenException(JMSServicesMgr.java:112)
>> 	at com.ibm.mq.jms.MQSession.createQReceiver(MQSession.java:5995)
>> 	at com.ibm.mq.jms.MQQueueSession.createReceiver(MQQueueSession.java:326)
>> 	at com.ibm.mq.jms.MQQueueSession.createConsumer(MQQueueSession.java:382)
>> 	at
>> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createConsumer(AbstractPollingMessageListenerContainer.java:449)
>> 	at
>> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:217)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:903)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:886)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
>> 	at java.lang.Thread.run(Unknown Source)
>> 2008-05-13 09:13:50,539 [enerContainer-1] INFO 
>> efaultMessageListenerContainer - Successfully refreshed JMS Connection
>> 2008-05-13 09:13:55,461 [enerContainer-2] ERROR
>> efaultMessageListenerContainer - Setup of JMS message listener invoker
>> failed - trying to recover
>> javax.jms.IllegalStateException: MQJMS1112: JMS1.1 Ungültige Operation
>> für domänenspezifisches Objekt
>> 	at com.ibm.mq.jms.MQQueueSession.createTopic(MQQueueSession.java:734)
>> 	at
>> org.springframework.jms.support.destination.DynamicDestinationResolver.resolveTopic(DynamicDestinationResolver.java:86)
>> 	at
>> org.springframework.jms.support.destination.DynamicDestinationResolver.resolveDestinationName(DynamicDestinationResolver.java:63)
>> 	at
>> org.springframework.jms.support.destination.JmsDestinationAccessor.resolveDestinationName(JmsDestinationAccessor.java:100)
>> 	at
>> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:215)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:903)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:886)
>> 	at
>> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
>> 	at java.lang.Thread.run(Unknown Source)
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AMQ5.1-bridge-to-WebsphereMQ-5.3--%3E-javax.jms.IllegalStateException%3A-MQJMS1112-tp17204001p25996978.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message