首页 > 解决方案 > org.apache.camel.impl.HeaderFilterStrategyComponent 类型无法解析

问题描述

我的骆驼应用程序遇到以下问题:

该项目未构建,因为其构建路径不完整。找不到 org.apache.camel.impl.HeaderFilterStrategyComponent 的类文件。修复构建路径然后尝试构建这个项目骆驼

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>

注意: 它确实适用于骆驼核心 2.24.2。为什么它不适用于 3.0.0?什么是替代方案?

标签: javamavenapache-camel

解决方案


根据 Camel 3迁移指南。activemq-camel 组件已移至 Apache Camel 代码库。更新您的依赖项,例如:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-activemq</artifactId>
    <version>3.0.0</version>
</dependency>

推荐阅读