0

私は Camel と ActiveMQ を使い始めたばかりです。Maven を使用せずに、Eclipse から単純なコードを実行しようとしています。ただし、Bean の初期化中に失敗します。エラーから、JARのバージョンの違いが原因のようですが、見つけられませんでした。これを解決するのを手伝ってください。

import org.apache.camel.CamelContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestingBroker {

    private TestingBroker() {
        // Helper class
    }

    public static void main(final String[] args) throws Exception {

        AbstractApplicationContext aContext = new ClassPathXmlApplicationContext(
                "classpath:META-INF/spring/camel-config-client.xml");
        CamelContext ctx = (CamelContext) aContext.getBean("mycamelTemplate",   CamelContext.class);
        ctx.addRoutes(new BuildTwitterComponent());
        ctx.start();
    }
}

Here's the camel-config-client.xml file contents-
<?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:camel="http://camel.apache.org/schema/spring"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring-2.11.1.xsd">

  <camel:camelContext id="my-camel-client">
    <camel:template id="mycamelTemplate"/>
  </camel:camelContext>

  <bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="tcp://135.207.178.237:61616" />
  </bean>

</beans>

------------------------------
I have spring.jar.2.5.6 and camel-spring-2.11.1 JAR in the classpath. Pls suggest what am i missing here.
Thanks!
GR
4

1 に答える 1