2017-04-27 212 views
1

我大家,的Apache ServiceMix的連接到IBM的WebSphere 8.0

我想來自IBM的WebSphere 7.0.0.5將我們的MQ接口8.0.0.6版本。作爲一個EJB容器,我們使用的是Apache Servicemix 7.0.0。 當切換到8.0.0.6庫收到以下錯誤堆棧:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ibmmq' defined in URL [bundle://231.0:0/META-INF/spring/mq-test.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to required type 'javax.jms.ConnectionFactory' for property 'connectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:938)[150:org.apache.servicemix.bundles.spring-context:3.2.17.RELEASE_1] 
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[217:org.springframework.osgi.core:1.2.1] 
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[217:org.springframework.osgi.core:1.2.1] 
    at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[217:org.springframework.osgi.core:1.2.1] 
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[217:org.springframework.osgi.core:1.2.1] 
    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[218:org.springframework.osgi.extender:1.2.1] 
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_102] 
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to required type 'javax.jms.ConnectionFactory' for property 'connectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found 
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:464)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:495)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:489)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1465)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1160)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    ... 13 more 
Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.ibm.mq.jms.MQQueueConnectionFactory] to required type [javax.jms.ConnectionFactory] for property 'connectionFactory': no matching editors or conversion strategy found 
    at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:267)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:449)[149:org.apache.servicemix.bundles.spring-beans:3.2.17.RELEASE_1] 
    ... 19 more 

下面一行是奇怪,我,我自己也沒有這種結論:

無法將屬性值轉換類型爲'com.ibm.mq.jms.MQQueueConnectionFactory'的屬性'connectionFactory'的所需類型爲'javax.jms.ConnectionFactory';嵌套異常是java.lang.IllegalStateException:無法將屬性'connectionFactory'的類型[com.ibm.mq.jms.MQQueueConnectionFactory]類型的值轉換爲所需類型[javax.jms.ConnectionFactory]:未找到匹配的編輯器或轉換策略

要安裝的功能,我使用了以下功能的XML文件:

<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"> 
    <feature name='ibm-mq-75' version='7.5.0.0'> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.mq.osgi.directip_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.mq.osgi.java_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.commonservices.j2se_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.jms_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.nls_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.nls_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.prereq_7.5.0.0.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 75/java/lib/OSGi/com.ibm.msg.client.osgi.wmq_7.5.0.0.jar</bundle> 
    </feature> 

    <feature name='ibm-mq-80' version='8.0.0.6'> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.mq.osgi.java_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.commonservices.j2se_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.jms.prereq_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.jms_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.nls_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.nls_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.wmq.prereq_8.0.0.6.jar</bundle> 
    <bundle start-level='85'>file:o:/tools/IBM/Websphere MQ 80/java/lib/OSGi/com.ibm.msg.client.osgi.wmq_8.0.0.6.jar</bundle> 
    </feature> 
</features> 

示例路徑看起來像如下:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" 
     xmlns:context="http://www.springframework.org/schema/context" 
     xmlns:util="http://www.springframework.org/schema/util" xmlns:camel="http://camel.apache.org/schema/spring" 
     xmlns:p="http://www.springframework.org/schema/p" 
     xsi:schemaLocation="http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd"> 

    <!--bean id="conFactoryFactory" class="com.ibm.mq.jms.MQConnectionFactoryFactory" /--> 

    <bean id="conFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory" > 
    <property name="transportType"> 
     <util:constant static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP" /> 
    </property> 
    <property name="hostName" value="gs3-mqsrv-lnx" /> 
    <property name="port" value="1414" /> 
    <property name="queueManager" value="qm.gb30.realtime" /> 
    <property name="channel" value="ch.realtime" /> 
    <property name="useConnectionPooling" value="true" /> 
    </bean>    

    <bean id="ibmmq" class="org.apache.camel.component.jms.JmsComponent"> 
    <property name="connectionFactory" ref="conFactory" /> 
    </bean> 

    <camel:camelContext id="ibm-mq-test"> 

    <!-- Uplink from file -> mq --> 
    <camel:route id="mq-uplink"> 
     <camel:from uri="file:mq/in" /> 
     <camel:transacted /> 
     <camel:to uri="ibmmq:lq.gslisa.src1" /> 
     <camel:log message="Put message into mq!" /> 
    </camel:route> 

    <!-- Downlink from mq -> file --> 
    <camel:route id="mq-downlink"> 
     <camel:from uri="ibmmq:lq.gslisa.src1" /> 
     <camel:transacted /> 
     <camel:to uri="file:mq/out" /> 
     <camel:log message="Read message from mq!" /> 
    </camel:route> 

    </camel:camelContext> 

</beans> 

如前所述,用F eature:ibm-mq-75所有東西都是這個東西,把它改成ibm-mq-80顯示錯誤。 任何人都可以幫忙嗎?

感謝, 約爾格

+0

看來,這個問題是通過將JMS版本引起的: ServiceMix的使用JMS 1.1與Geronimo-規格 - 1.1.1 IBM-MQ LIB使用JMS其設置/出口在庫2.0: com.ibm.msg.client.osgi.jms.prereq_8.0.0.6.jar 構建不使用ASM的藍圖測試用例按預期工作。 那麼我怎樣才能告訴接口包使用IBM-jms版本呢? – jjansen

回答

1

執行以下步驟,似乎解決了我的問題:

  1. 從駱駝JMS切換​​MQ-包駱駝SJMS
  2. 迫使ServiceMix的對清理緩存每個啓動。