【问题标题】:Failed to resolve endpoint: No component found with scheme: exec无法解析端点:没有找到带有方案的组件:exec
【发布时间】:2023-03-07 16:53:02
【问题描述】:

我正在尝试使用 Apache Camel 调用一个简单的 shell 脚本,但出现错误:

Failed to resolve endpoint: exec:///usr/local/karaf/data/tmp/test.sh due to: No component found with scheme: exec

在我的 camel-context.xml 中有

  <route id="common_route">
    <from uri="direct:common_route" />
    <to uri="exec:/usr/local/karaf/data/tmp/test.sh"/>
  </route>

在我的 pom.xml 中

 <dependency>
   <groupId>org.apache.camel</groupId>
   <artifactId>camel-exec</artifactId>
   <version>${camel.version}</version>
 </dependency>

我们使用的是 Camel 版本 2.15.3。我们正在使用 Spring Camel。 有任何想法吗?这是必须如此简单以至于非常令人沮丧的事情之一。

顺便说一句,如果我使用它没有区别 exec:/usr/.... 或者 exec:///usr/....

提前致谢。

【问题讨论】:

    标签: apache-camel spring-camel


    【解决方案1】:

    我想通了。文档没有提到这一点..至少,没有在骆驼执行页面上。

    1:我必须添加该行 org.apache.camel.component.exec 到我的 pom.xml 中

     <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Spring-Context>*;create-asynchronously:=false</Spring-Context>
                            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                            <Import-Package>
                              ...
                              org.apache.camel.component.exec
                              ...
    

    2:我必须在 Karaf 控制台中运行以下命令:

    bundle:install mvn:org.apache.camel/camel-exec/2.15.3
    bundle:install mvn:org.apache.commons/commons-exec/1.3
    bundle:install mvn:commons-io/commons-io/1.4
    

    【讨论】:

      猜你喜欢
      • 2018-01-06
      • 1970-01-01
      • 2015-01-22
      • 1970-01-01
      • 2017-11-16
      • 2014-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多