【问题标题】:How to configure the Composed Task Runner如何配置组合任务运行器
【发布时间】:2019-12-13 10:09:42
【问题描述】:

我正在使用 Spring Cloud Data Flow 部署 Composed Task,并且我已将 Composed Task Runner 注册为 Spring Cloud Data Flow 的应用程序,如下所示:

app register --name composed-task-runner --type task --uri  maven://org.springframework.cloud.task.app:composedtaskrunner-task:2.0.0.RELEASE

但是在启动后,我得到了以下错误:

原因:java.lang.IllegalStateException:无法加载驱动程序类:oracle.jdbc.OracleDriver 在 org.springframework.util.Assert.state(Assert.java:94) ~[spring-core-5.1.11.RELEASE.jar!/:5.1.11.RELEASE] 在 org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:222) ~[spring-boot-autoconfigure-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] 在 org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:174) ~[spring-boot-autoconfigure-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] 在 org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:43) ~[spring-boot-autoconfigure-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] ...

在一些文档中说我必须配置组合任务运行程序以使用 Spring Cloud Data Flow 实例正在使用的相同数据源,或者所有子应用程序必须具有与其 pom.xml 中枚举的组合任务运行程序相同的数据库依赖项或 gradle.build 文件。

我的 SCDF 的 pom.xml 中有 ojdbc8

<dependency>
    <groupId>com.oracle.ojdbc</groupId>
    <artifactId>ojdbc8</artifactId>
    <version>19.3.0.0</version>
</dependency>

那么如何为 Composed Task Runner 配置这些属性呢?

【问题讨论】:

    标签: spring-cloud-dataflow


    【解决方案1】:

    如果您使用外部数据库自定义 SCDF,则在 SCDF POM 中添加适当的 JDBC 驱动程序并构建服务器后,您需要使用适当的 datasource 属性启动 SCDF 服务器,如 here 所述。

    一旦在 SCDF 服务器上设置了这些数据源属性,它们也会被传递给 Composed Task Runner。

    Spring Cloud Data Flow Samples 中有一些关于如何构建自定义 SCDF 服务器的示例项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-17
      • 1970-01-01
      • 2017-05-30
      • 2020-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多