<p>I'm trying to install a <a href="https://github.com/spring-cloud/spring-cloud-dataflow-samples/tree/master/custom-dataflow-builds/dataflow-server-25x" rel="nofollow noreferrer">custom built SCDF2.5.1</a>(To add oracle Driver) into openshift (Followed the Kubectl installation doc for SCDF). I modified the deployment.yaml to pull this custom SCDF docker image of mine from git repo. Now when I start the container I get the below error</p>

<pre><code>INFO  org.hibernate.dialect.Dialect.&lt;init&gt; - HHH000400: Using dialect: org.hibernate.dialect.Oracle12cDialect
INFO  org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator.initiateService - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
INFO  org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.buildNativeEntityManagerFactory - Initialized JPA EntityManagerFactory for persistence unit 'default'
INFO  org.springframework.cloud.dataflow.configuration.metadata.ApplicationConfigurationMetadataResolverAutoConfiguration.registryConfigurationMap - Final Registry Configurations: {registry-1.docker.io=RegistryConfiguration{registryHost='registry-1.docker.io', user='null', secret='****'', authorizationType=dockeroauth2, manifestMediaType='application/vnd.docker.distribution.manifest.v2+json', disableSslVerification='false', extra={registryAuthUri=https://auth.docker.io/token?service=registry.docker.io&amp;scope=repository:{repository}:pull&amp;offline_token=1&amp;client_id=shell}}}
WARN  org.springframework.cloud.dataflow.server.config.features.SchedulerConfiguration.primaryTaskPlatform - TaskPlatform Kubernetes is selected as primary but has no TaskLaunchers configured
WARN  org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext.refresh - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.dataflow.server.config.features.TaskConfiguration': Unsatisfied dependency expressed through field 'schedulerService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schedulerService' defined in class path resource [org/springframework/cloud/dataflow/server/config/features/SchedulerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.dataflow.server.service.SchedulerService]: Factory method 'schedulerService' threw exception; nested exception is java.lang.IllegalStateException: No valid primary TaskPlatform configured
INFO  org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.destroy - Closing JPA EntityManagerFactory for persistence unit 'default'
INFO  com.zaxxer.hikari.HikariDataSource.close - HikariPool-1 - Shutdown initiated...
INFO  com.zaxxer.hikari.HikariDataSource.close - HikariPool-1 - Shutdown completed.
INFO  org.apache.catalina.core.StandardService.log - Stopping service [Tomcat]
ERROR 
</code></pre>

<p>I saw a thread related to this post where the <a href="https://github.com/spring-cloud/spring-cloud-dataflow-server-kubernetes/issues/323" rel="nofollow noreferrer">fix</a> was provided to spring-cloud-dataflow-server-kubernetes and spring-cloud-dataflow-server-kubernetes-autoconfigure project. But I'm not sure whether thsose changes are available for the custom build 2.5.1 Release. Also I checked my deployment.yaml and the toggle "SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED" was set to true. </p>

<p>In deployment.yaml I have removed database service &amp; config, removed the scdf-server config as well, as I added the driver properties in application.properties while building the docker image itself. Below are the deployment.yaml and application.properties file which built into the scdf jar. FYI, removing the scdf-server config from deployment.yaml has no effect on the the failure. The above exception remains same. Also removed the skipper URI.</p>

<p><strong>deployment.yaml</strong></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: customscdf-image
  labels:
    app: customscdf-image
spec:
  selector:
    matchLabels:
      app: customscdf-image
  replicas: 1
  template:
    metadata:
      labels:
        app: customscdf-image
    spec:
      containers:
      - name: customscdf-image
        image: docker-registry.default.svc:5000/scdfadmin/customscdf-image
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        livenessProbe:
          httpGet:
            path: /management/health
            port: 80
          initialDelaySeconds: 45
        readinessProbe:
          httpGet:
            path: /management/info
            port: 80
          initialDelaySeconds: 45
        resources:
          limits:
            cpu: 1.0
            memory: 2048Mi
          requests:
            cpu: 0.5
            memory: 1024Mi
        env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: SERVER_PORT
          value: '80'
        - name: SPRING_CLOUD_CONFIG_ENABLED
          value: 'false'
        - name: SPRING_CLOUD_DATAFLOW_FEATURES_ANALYTICS_ENABLED
          value: 'true'
        - name: SPRING_CLOUD_DATAFLOW_FEATURES_SCHEDULES_ENABLED
          value: 'true'
        - name: SPRING_CLOUD_DATAFLOW_TASK_COMPOSED_TASK_RUNNER_URI
          value: 'docker://springcloud/spring-cloud-dataflow-composed-task-runner:2.6.0.BUILD-SNAPSHOT'
        - name: SPRING_CLOUD_KUBERNETES_CONFIG_ENABLE_API
          value: 'false'
        - name: SPRING_CLOUD_KUBERNETES_SECRETS_ENABLE_API
          value: 'false'
        - name: SPRING_CLOUD_KUBERNETES_SECRETS_PATHS
          value: /etc/secrets
        - name: SPRING_CLOUD_DATAFLOW_SERVER_URI
          value: '${HOST_NAME}:9393'
          # Add Maven repo for metadata artifact resolution for all stream apps
        - name: SPRING_APPLICATION_JSON
          value: "{ \"maven\": { \"local-repository\": null, \"remote-repositories\": { \"repo1\": { \"url\": \"https://repo.spring.io/libs-snapshot\"} } } }"
      serviceAccountName: scdf-sa
</code></pre>

<p><strong>application.properties</strong></p>

<pre><code>spring.application.name=CUSTOMSCDF
spring.datasource.url=DATASOURCE_URL_FOR_ORACLE_DB
spring.datasource.username=user_name
spring.datasource.password=PASSWORD
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver

spring.flyway.enabled=false

spring.jpa.show-sql=true
spring.jpa.hibernate.use-new-id-generator-mappings=true

logging.level.root=info
logging.file.max-size=5GB
logging.file.max-history=30 
logging.pattern.console=%d{dd-MM-yyyy HH:mm:ss.SSS} [%thread] %-5level %logger.%M - %msg%n
</code></pre>

<p><strong>Dockerfile</strong> - Which will be built as customscdf-image used above</p>

<pre><code>FROM maven:3.5.2-jdk-8-alpine AS MAVEN_BUILD

COPY pom.xml /build/
COPY src /build/src/

WORKDIR /build/
RUN mvn package

FROM openjdk:8-jre-alpine

WORKDIR /app
COPY --from=MAVEN_BUILD /build/target/custom-0.0.1-SNAPSHOT.jar /app/

ENTRYPOINT ["java", "-jar", "custom-0.0.1-SNAPSHOT.jar"]
</code></pre>

<p>So what am I doing wrong or missing here? Please advice.</p>

<p>Thanks in advance.</p>

Rajesh2389
<p>Most likely you are missing task platform configuration <a href="https://github.com/spring-cloud/spring-cloud-dataflow/blob/43247faf52bd48c5e51ece6fdb72520e1c286b01/src/kubernetes/server/server-config.yaml#L35-L41" rel="nofollow noreferrer">server-config.yaml</a> which is part of a k8s deployment files. As you're using your own <code>application.properties</code> file I have a feeling you didn't use that k8s config file.</p>
