繁体   English   中英

使用Apache Camel的JMS / JNP连接

[英]JMS/JNP Connection using Apache Camel

我试图使用Apache Camel与JMS建立连接,但服务器使用的是JNP协议,但始终以异常结尾。 在这里需要帮助,我在这里想念还是做错了什么。

技术栈。

  • JBoss保险丝6.3
  • Apache Camel(用于集成)

蓝图:

<bean id="remoteJndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.provider.url">jnp://X.X.X.X:1099</prop>
            <prop key="java.naming.factory.url.pkgs">org.jnp.interfaces:org.jboss.naming</prop>
            <prop key="java.naming.factory.initial">org.jnp.interfaces.NamingContextFactory</prop>
        </props>
    </property>
</bean>
<bean id="remoteConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"  init-method="afterPropertiesSet">
    <property name="jndiTemplate" ref="remoteJndiTemplate"/>
    <property name="jndiName" value="ConnectionFactory" />
    <property name="lookupOnStartup" value="false" />
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>
<bean id="jmsInConnectionFactory" factory-ref="remoteConnectionFactory" factory-method="getObject" />
<bean id="jmsComponent" class="org.apache.camel.component.jms.JmsComponent">
    <property name="configuration">
        <bean class="org.apache.camel.component.jms.JmsConfiguration">
            <property name="connectionFactory" ref="jmsInConnectionFactory"/>
        </bean>
    </property>
</bean>

例外:

org.osgi.service.blueprint.container.ComponentDefinitionException: Error setting property: PropertyDescriptor <name: expectedType, getter: class org.springframework.jndi.JndiObjectLocator.getExpectedType(), setter: [class org.springframework.jndi.JndiObjectLocator.setExpectedType(class java.lang.Class)]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:963)[23:org.apache.aries.blueprint.core:1.4.5]
Caused by: java.lang.Exception: Unable to convert
at org.apache.aries.blueprint.container.AggregateConverter.convertFromString(AggregateConverter.java:252)[23:org.apache.aries.blueprint.core:1.4.5]
Caused by: java.lang.ClassNotFoundException: javax.jms.QueueConnectionFactory not found by IDC-mnp-npg [294]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)[org.apache.felix.framework-4.4.1.jar:]

看起来您是基于由异常导致的根目录丢失了类路径上的JMS API jar:

Caused by: java.lang.ClassNotFoundException: javax.jms.QueueConnectionFactory not found by IDC-mnp-npg

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM