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

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

问题描述

我想配置Apache骆驼在Spring在Java的配置方式在此详细的例如的。但是我卡在依赖一步,因为 BundleContextAware 和(及物动词)的BundleContext 不能得到解决。看来,必要的传递依赖不会被下载。这是我的pom.xml:

 <性状>
    < apache.camel.version> 2.9.0< /apache.camel.version>
< /性状><&依赖性GT;
  <&的groupId GT; org.apache.camel< /的groupId>
  <&的artifactId GT;骆驼核心和LT; / artifactId的>
  <&版GT; $ {apache.camel.version}< /版本>
< /依赖性>
<&依赖性GT;
  <&的groupId GT; org.apache.camel< /的groupId>
  <&的artifactId GT;骆驼弹簧< / artifactId的>
  <&版GT; $ {apache.camel.version}< /版本>
< /依赖性>
<&依赖性GT;
  <&的groupId GT; org.apache.camel< /的groupId>
  <&的artifactId GT;骆驼弹簧javaconfig< / artifactId的>
  <&版GT; $ {apache.camel.version}< /版本>
< /依赖性>

下面是从例如code片断:

  / **
 *从文件系统路由器到一个ActiveMQ的队列,然后到文件系统
 *
 * @version
 * /
@组态
公共类MyRouteConfig扩展SingleRouteCamelConfiguration
    实现的InitializingBean,BundleContextAware {    私有的BundleContext的BundleContext;
    ...
    ...
}


解决方案

嗯这个例子被重构也成为OSGi的部署。因此,有样品code一些OSGi的类。

您应该只删除,如果你不使用OSGi的,如取出code约 BundleContextAware 的BundleContext

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

解决方案

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

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

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

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