【问题标题】:spring context error with processing xml处理xml的spring上下文错误
【发布时间】:2014-03-24 13:35:54
【问题描述】:

我在处理具有非常简单内容的root-context 时遇到问题。我只想配置 camel-clientcamel proxy bean 但我得到:

处理 XML 'Provider 时发生错误 com.sun.xml.internal.bind.v2.ContextFactory 无法实例化: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:1 IllegalAnnotationExceptions 类的计数有两个属性 同名“输出”这个问题与以下有关 位置:在公共 java.util.List
org.apache.camel.model.ResequenceDefinition.getOutputs() 在 org.apache.camel.model.ResequenceDefinition 这个问题与 以下位置:在私有 java.util.List
org.apache.camel.model.ResequenceDefinition.outputs 在 org.apache.camel.model.ResequenceDefinition '。有关更多信息,请参阅错误日志 详情

这是我的root-context.xml

<?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:tx="http://www.springframework.org/schema/tx"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:camel="http://camel.apache.org/schema/spring"
    xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <!-- Root Context: defines shared resources visible to all other web components -->

    <camel:camelContext id="camel-client">

    </camel:camelContext>


    <!-- Camel proxy for a given service, in this case the JMS queue -->
    <camel:proxy
        id="serviceProxy"
        camelContextId="camel-client"
        serviceInterface="pl.test.Service"
        serviceUrl="jms:queue:test?transferException=true"/>


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

    <jee:jndi-lookup id="connectionFactory" jndi-name="QueueConnectionFactory">

    </jee:jndi-lookup>

</beans>

我的pom.xml 中有camel 依赖项。任何人都可以给我一个提示我在哪里做错了吗?

【问题讨论】:

    标签: spring apache-camel


    【解决方案1】:

    根据骆驼代​​理documentation&lt;camel:proxy&gt;必须在&lt;camel:camelContext&gt;内:

    <camel:camelContext id="camel-client">
        <camel:proxy
            id="serviceProxy"
            camelContextId="camel-client"
            serviceInterface="pl.test.Service"
            serviceUrl="jms:queue:test?transferException=true"/>
    </camel:camelContext>
    

    【讨论】:

      猜你喜欢
      • 2012-10-13
      • 2020-10-04
      • 1970-01-01
      • 1970-01-01
      • 2016-02-23
      • 1970-01-01
      • 2021-08-31
      • 1970-01-01
      • 2019-10-27
      相关资源
      最近更新 更多