【问题标题】:Jms Connection using Apache camel使用 Apache 骆驼的 Jms 连接
【发布时间】:2018-04-29 11:31:35
【问题描述】:

我正在尝试使用服务器 Apache Camel 与 JMS 建立连接 正在使用 Jnp 协议。但是我在尝试时遇到了异常。需要 帮助,如果我遗漏任何东西或做错了什么。我有 JMS API pom中的jar依赖。

技术栈:

  • Jboss Fuse 6.3
  • Apache Camel(用于集成)

蓝图:

<bean class="org.springframework.jndi.JndiTemplate" 
 id="remoteJndiTemplate">
    <property name="environment">
        <props>
            <prop key="java.naming.provider.url">jnp://x.x.x.x:yyyy</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 class="org.springframework.jndi.JndiObjectFactoryBean"
    id="remoteConnectionFactory" init-method="afterPropertiesSet">
    <property name="jndiTemplate" ref="remoteJndiTemplate"/>
    <property name="jndiName" value="ConnectionFactory"/>
    <property name="lookupOnStartup" value="false"/>
    <!-- <property name="proxyInterface" value="javax.jms.QueueConnectionFactory"/> -->
    <property name="expectedType" value="javax.jms.QueueConnectionFactory"/>
</bean>
<bean factory-method="getObject"
    factory-ref="remoteConnectionFactory" id="jmsInConnectionFactory"/>
<bean class="org.apache.camel.component.jms.JmsComponent" id="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: Unable to initialize bean remoteConnectionFactory
Caused by: java.lang.IllegalArgumentException: interface javax.jms.QueueConnectionFactory is not visible from class loader

【问题讨论】:

    标签: java apache-camel jms jbossfuse jnp


    【解决方案1】:

    jnp 是 JBoss 中使用的 JNDI 命名服务”。 我认为下面的测试用例可以进一步帮助你。 activemq-unit using spring JNDI

    关于

    java.lang.IllegalArgumentException:接口 javax.jms.QueueConnectionFactory 在类加载器中不可见

    这看起来像是不同的问题。

    【讨论】:

      猜你喜欢
      • 2014-04-26
      • 1970-01-01
      • 1970-01-01
      • 2018-03-07
      • 2012-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-01
      相关资源
      最近更新 更多