Spring批处理/集成入站通道适配器



我的入站通道适配器有问题,如果本地目录不存在,整个应用程序将失败,尽管我将自动创建本地目录设置为true。在创建bean的一开始,它似乎就失败了。我该怎么做才能使它创建目录,或者至少不会失败?

非常感谢。

好吧,您也应该共享config和StackTrace。

拥有auto-create-local-directory="true"directory does not exist可以告诉我您的操作系统用户没有创建该目录的权限。仅仅因为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.");

在创建bean的最初阶段。

相关内容

最新更新