我在 Camel 应用程序中遇到以下问题:
The project was not built since its build path is incomplete. Cannot find the class file for org.apache.camel.impl.HeaderFilterStrategyComponent. Fix the build path then try building this project camel
public class SendMessageToActiveMq {
public static void main(String[] args) throws Exception {
ConnectionFactory factory = new ActiveMQConnectionFactory();
CamelContext context = new DefaultCamelContext();
context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(factory));
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
}
这是我的 Maven pom 依赖项:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
<version>5.15.11</version>
</dependency>
注意: 它确实适用于camel-core 2.24.2。为什么它不能与 3.0.0 一起使用?有什么替代方案吗?
最佳答案
根据 Camel 3 migration guide 。 activemq-camel 组件已移至 Apache Camel 代码库。更新您的依赖项,例如:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-activemq</artifactId>
<version>3.0.0</version>
</dependency>
关于java - 无法解析 org.apache.camel.impl.HeaderFilterStrategyComponent 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59290279/