简体   繁体   English

Spring Batch/集成入站通道适配器

[英]Spring Batch/Integration Inbound Channel Adapter

I am having an issue with the inbound channel adapter and the whole application failing if the local directory does not exist, although I have auto-create-local-directory set to true.我遇到了入站通道适配器的问题,如果本地目录不存在,整个应用程序就会失败,尽管我将 auto-create-local-directory 设置为 true。 It seems to be failing in the very beginning when creating the bean.创建 bean 时似乎一开始就失败了。 What can I do to make it either create the directory or at least not fail?我该怎么做才能让它创建目录或至少不会失败?

Thanks a lot.非常感谢。

Well, you should share config and StackTrace as well.好吧,您也应该共享配置和 StackTrace。

Having auto-create-local-directory="true" and directory does not exist can tell me that your OS user doesn't have permission to create that directory. auto-create-local-directory="true"并且directory does not exist可以告诉我您的操作系统用户没有创建该目录的权限。 Just because FileReadingMessageSource :仅仅因为FileReadingMessageSource

protected void onInit() {
    Assert.notNull(directory, "'directory' must not be null");
    if (!this.directory.exists() && this.autoCreateDirectory) {
        this.directory.mkdirs();
    }
    Assert.isTrue(this.directory.exists(),
            "Source directory [" + directory + "] does not exist.");

in the very beginning when creating the bean.在创建 bean 的一开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM