BundleContextAware 和 BundleContext 的 Apache Camel maven 依赖问题 [英] Apache Camel maven dependency issue with BundleContextAware and 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,你应该删除它,例如删除关于 BundleContextAware
和 BundleContext
You should just remove that if you do not use OSGi, eg remove the code about BundleContextAware
and BundleContext
这篇关于BundleContextAware 和 BundleContext 的 Apache Camel maven 依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!