amazon-s3 - 上传到 S3 的骆驼路由失败
问题描述
我试图构建一个检测 .csv 文件并将其上传到我的 S3 存储桶的基本路由。
csv 文件被 geected 并且除了 .to("aws-s3...") 部分之外的路由工作。
我已经尝试过这个问题的解决方案,但它失败了。
我的路线:
public class CsvToS3Route extends RouteBuilder {
@Override
public void configure() throws Exception {
from("file:./src/main/resources/mycsvfilesfolder?filterFile=${file:name.ext.single} =~ 'csv'")
.convertBodyTo(byte[].class)
.setHeader(S3Constants.CONTENT_LENGTH, simple("${in.header.CamelFileLength}"))
.setHeader(S3Constants.KEY,simple("${in.header.CamelFileNameOnly}"))
.to("aws-s3://my-bucket?deleteAfterWrite=false®ion=eu-west-1&accessKey=mypublickey&secretKey=RAW(mysecretkey)")
.log("done.");
}}
我的主要课程:
@Component
public class CamelRoutes {
Logger logger = LoggerFactory.getLogger(CamelRoutes.class);
private Main main;
private CamelContext context;
@Bean
public void run() throws Exception {
this.main = new Main();
this.context = new DefaultCamelContext(registry);
context.addRoutes(new CsvToS3Route());
main.getCamelContexts().clear();
main.getCamelContexts().add(context);
// Run Camel forever
logger.info("Starting Camel Application");
main.setDuration(-1);
main.run();
}}
错误
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.apache.camel.support.DefaultComponent.doStart(DefaultComponent.java:245)
The following method did not exist:
org.apache.camel.CamelContext.getPropertiesComponent(Z)Lorg/apache/camel/spi/PropertiesComponent;
The method's class, org.apache.camel.CamelContext, is available from the following locations:
jar:file:/Users/myuser/.gradle/caches/modules-2/files-2.1/org.apache.camel/camel-core/2.23.2.fuse-750029-redhat-00001/93a0f16a539d46373c121d4b10cd9fc844c8779a/camel-core-2.23.2.fuse-750029-redhat-00001.jar!/org/apache/camel/CamelContext.class
jar:file:/Users/myuser/.gradle/caches/modules-2/files-2.1/org.apache.camel/camel-api/3.0.0-M2/7724c277b1f57116083c555ccb3bfd63a4e74ea0/camel-api-3.0.0-M2.jar!/org/apache/camel/CamelContext.class
It was loaded from the following location:
file:/Users/myuser/.gradle/caches/modules-2/files-2.1/org.apache.camel/camel-core/2.23.2.fuse-750029-redhat-00001/93a0f16a539d46373c121d4b10cd9fc844c8779a/camel-core-2.23.2.fuse-750029-redhat-00001.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.apache.camel.CamelContext
2020-02-13 12:53:28.898 INFO 31954 --- [ngupInterceptor] o.a.c.m.MainSupport$HangupInterceptor : Received hang up - stopping the main instance.
2020-02-13 12:53:28.899 INFO 31954 --- [ngupInterceptor] o.apache.camel.impl.DefaultCamelContext : Apache Camel 2.23.2.fuse-750029-redhat-00001 (CamelContext: camel-1) is shutting down
2020-02-13 12:53:28.911 INFO 31954 --- [ngupInterceptor] o.apache.camel.impl.DefaultCamelContext : Apache Camel 2.23.2.fuse-750029-redhat-00001 (CamelContext: camel-1) uptime 0.213 seconds
2020-02-13 12:53:28.911 INFO 31954 --- [ngupInterceptor] o.apache.camel.impl.DefaultCamelContext : Apache Camel 2.23.2.fuse-750029-redhat-00001 (CamelContext: camel-1) is shutdown in 0.012 seconds
Process finished with exit code 1
有什么我想念的吗?
解决方案
推荐阅读
- macos - Applescript 在处理应用程序图标上放置的图像文件时遇到问题
- intellij-idea - 显示本地源代码的工具(最好是 IntelliJ 插件)已过时
- c# - 如何显示返回值?
- reactjs - 使用 Cypress 和 `mock-sockets` 来发出消息
- sql-server - ORDER BY with COALESCE with '~' 而不是 'ZZZ' 将 NULL 值排序到顶部
- python - Pythonic 强制执行必须调用方法的顺序的方法
- c# - 适用于应用程序的 Visual Studio 工具:如何现在检查二进制文件的状态并从宿主应用程序编译源代码
- reactjs - 为什么我的复选框不出来?我使用 react、typescript 和 next.Js
- python - Tensorflow - numpy梯度检查不起作用
- wordpress - 为什么要重新连接到 save_post