0
votes

I were using Spring Cloud Data Flow to deploy the Composed Task and I had registered the Composed Task Runner as an application with Spring Cloud Data Flow, as follows:

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

However after launching, I got the below error:

Caused by: java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.OracleDriver at org.springframework.util.Assert.state(Assert.java:94) ~[spring-core-5.1.11.RELEASE.jar!/:5.1.11.RELEASE] at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.determineDriverClassName(DataSourceProperties.java:222) ~[spring-boot-autoconfigure-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.initializeDataSourceBuilder(DataSourceProperties.java:174) ~[spring-boot-autoconfigure-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] at org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration.createDataSource(DataSourceConfiguration.java:43) ~[spring-boot-autoconfigure-2.1.10.RELEASE.jar!/:2.1.10.RELEASE] ...

In some document said that I must configure the Composed Task Runner to use the same datasource that the Spring Cloud Data Flow instance is using or all child apps must have the same database dependency as the composed task runner enumerated in their pom.xml or gradle.build file.

I got ojdbc8 in my SCDF's pom.xml

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

So how to configure these properties for the Composed Task Runner?

1

1 Answers

0
votes

If you are customizing SCDF with the external database, after you add the appropriate JDBC driver in the SCDF POM and build the server, you need to start the SCDF server with the appropriate datasource properties as outlined here.

Once these data source properties are set at the SCDF server, then these are passed to the Composed Task Runner as well.

There are some sample projects on how to build custom SCDF server in Spring Cloud Data Flow Samples.