apache-camel - 无法解析端点:没有找到带有方案的组件:exec
问题描述
我正在尝试使用 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/....
提前致谢。
解决方案
我想到了。文档没有提到这一点..至少,没有在骆驼执行页面上。
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
推荐阅读
- java - 如何在 WSO2 4.9.0 中设置自定义用户代理
- python-3.x - 如何从python中的pandas数据框中的列中提取关键字(字符串)
- service-worker - 渐进式 Web 应用程序 Service Worker 能否找出它在哪个设备上运行(智能手机、平板电脑……)?
- java - 从 Activity B Android 调用 Activity A 方法
- php - 从 PHP 中的 dateTime 获取日期
- google-chrome - 为什么我无法将 .babylon 文件导入到 babylon JS?
- python - 试图将二进制字符串转换为十进制,计算不正确,我不明白为什么
- python - 从 CSV 文件中读取大数字时,pandas 将其推断为字符串
- javascript - 如何配置 jQuery 事件在触发之前不传播
- sql - SQL 列到文本框(来自 ComboBox)