gpt4 book ai didi

spring - BundleContextAware 和 BundleContext 的 Apache Camel maven 依赖问题

转载 作者:行者123 更新时间:2023-12-04 02:45:55 24 4
gpt4 key购买 nike

我正在尝试以 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;
...
...
}

最佳答案

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

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

的代码

关于spring - BundleContextAware 和 BundleContext 的 Apache Camel maven 依赖问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18830114/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com