BundleContextAware和BundleContext的Apache Camel maven依赖问题

时间:2013-09-16 14:09:23

标签: spring maven apache-camel

我正在尝试使用Java配置方式在Spring中配置Apache Camel,详见本example。但是我陷入了依赖步骤,因为无法解析BundleContextAware和(传递)BundleContext。似乎没有下载必要的传递依赖项。这是我的pom.xml:

<properties>
    <apache.camel.version>2.9.0</apache.camel.version>
</properties>

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-core</artifactId>
  <version>${apache.camel.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-spring</artifactId>
  <version>${apache.camel.version}</version>
</dependency>
<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-spring-javaconfig</artifactId>
  <version>${apache.camel.version}</version>
</dependency>

以下是示例中的代码段:

/**
 * Router from a file system to an ActiveMQ queue and then to a file system
 *
 * @version 
 */
@Configuration
public class MyRouteConfig extends SingleRouteCamelConfiguration 
    implements InitializingBean, BundleContextAware {

    private BundleContext bundleContext;
    ...
    ...
}

2 个答案:

答案 0 :(得分:4)

啊这个例子被重构为也可以在OSGi中部署。因此,示例代码中有一些OSGi类。

如果你不使用OSGi,你应该删除它,例如删除关于BundleContextAwareBundleContext的代码

答案 1 :(得分:0)

非OSGI MyRouteConfig示例可用here