Apache Camel maven 依赖问题与 BundleContextAware 和 BundleContext [英] Apache Camel maven dependency issue with BundleContextAware and BundleContext

查看:54
本文介绍了Apache Camel maven 依赖问题与 BundleContextAware 和 BundleContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以 Java 配置方式在 Spring 中配置 Apache Camel,详情请参见 示例.但是我被困在依赖步骤,因为 BundleContextAware 和(可传递的)BundleContext 无法解析.似乎没有下载必要的传递依赖项.这是我的 pom.xml:

I'm trying to configure Apache Camel in Spring in the Java config way as detailed in this example. However I'm stuck at the dependency step because BundleContextAware and (transitively) BundleContext cannot be resolved. It seems that the necessary transitive dependencies are not downloaded. Here is my 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>

这是示例中的代码片段:

Here's a code snippet from the example:

/**
 * 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;
    ...
    ...
}

推荐答案

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

Ah this example was refactored to also be deployable in OSGi. And therefore there is some OSGi classes in the sample code.

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

You should just remove that if you do not use OSGi, eg remove the code about BundleContextAware and BundleContext

这篇关于Apache Camel maven 依赖问题与 BundleContextAware 和 BundleContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆