【发布时间】:2019-05-18 14:42:49
【问题描述】:
我按照 spring 示例的指南在我的应用程序中配置了两个数据源:https://github.com/spring-cloud/spring-cloud-task/blob/master/spring-cloud-task-samples/multiple-datasources。 我使用的spring boot版本是:2.0.0.RELEASE 我使用的spring.cloud.task.version是:1.2.2.RELEASE。
此应用程序在我的本地计算机上运行良好,但是当部署到 AWS 时,我收到以下错误,定义类:CustomTaskConfigurer.java。 与此处定义相同:https://github.com/spring-cloud/spring-cloud-task/blob/master/spring-cloud-task-samples/multiple-datasources/src/main/java/io/spring/configuration/CustomTaskConfigurer.java
错误信息如下:
例外是 org.springframework.beans.factory.BeanCreationException:创建名为 'org.springframework.cloud.task.configuration.SimpleTaskConfiguration' 的 bean 时出错:调用 init 方法失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建文件 [/home/vcap/app/BOOT-INF/classes/com/xxx/configuration/CustomTaskConfigurer.class] 中定义的名称为“customTaskConfigurer”的 bean 时出错:Bean通过构造函数实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [com.xxx.configuration.CustomTaskConfigurer$$EnhancerBySpringCGLIB$$bc80cd46]:构造函数抛出异常;嵌套异常是 java.lang.IllegalStateException: Unable to create a TaskExecutionDao。
【问题讨论】:
标签: spring-boot spring-cloud-dataflow