cancel
Showing results for 
Search instead for 
Did you mean: 

SapMachine 11 with sap_java_buildpack issue

fabianorosa
Participant
0 Kudos

Hi all,

I'd like to use SapMachine version 11 with sap_java_buildpack to deploy a Java module (compiled with Java 11 version) using MTAR, but I'm getting an error in the deployment. I only can deploy successfully changing the buildpack from sap_java_buildpack to java_buildpack in the descriptor!

Bellow the MTA descriptor and the log with the error:

MTA yaml descriptor:

ID: solution_xpto
_schema-version: 3.3.0
version: 1.0.0
modules:
  - name: xpto_application
    type: java
    path: application
    parameters:
      memory: 1024M
      buildpack: sap_java_buildpack
    properties:
      JBP_CONFIG_COMPONENTS: '{ jres: ["JavaBuildpack::Jre::SapMachineJRE"] }'
      JBP_CONFIG_SAP_MACHINE_JRE: '{ jre: { version: "11.+" } }'
    build-parameters:
      builder: custom
      commands:
          - mvn clean package -DskipTests=true
      build-result: 'target/*.jar'

Log from SAP BTP Cloud Foundry:

2021-08-18T13:23:37.972+0000 [API/5] OUT Creating build for app with guid 0ce3a076-2ff5-4e4d-ba25-7b15c23d8bdd
2021-08-18T13:23:38.435+0000 [STG/0] OUT Downloading sap_java_buildpack...
2021-08-18T13:23:38.473+0000 [STG/0] OUT Downloaded sap_java_buildpack
2021-08-18T13:23:38.473+0000 [STG/0] OUT Cell a947a580-9226-491d-8034-de31667312c9 creating container for instance e326e2f6-6bf9-4641-a19c-4b3666b9b615
2021-08-18T13:23:38.781+0000 [STG/0] OUT Cell a947a580-9226-491d-8034-de31667312c9 successfully created container for instance e326e2f6-6bf9-4641-a19c-4b3666b9b615
2021-08-18T13:23:38.956+0000 [STG/0] OUT Downloading app package...
2021-08-18T13:23:38.956+0000 [STG/0] OUT Downloading build artifacts cache...
2021-08-18T13:23:39.006+0000 [STG/0] OUT Downloaded build artifacts cache (130B)
2021-08-18T13:23:39.562+0000 [STG/0] OUT Downloaded app package (41.8M)
2021-08-18T13:23:39.631+0000 [STG/0] OUT Finalizing Java application...
2021-08-18T13:23:39.715+0000 [STG/0] ERR /tmp/buildpacks/ec4877c1fdbf75e933d700b041e99f30/lib/ruby/add_java.rb:54:in `+': no implicit conversion of nil into String (TypeError)
2021-08-18T13:23:39.715+0000 [STG/0] ERR from /tmp/buildpacks/ec4877c1fdbf75e933d700b041e99f30/lib/ruby/add_java.rb:54:in `add_javavm'
2021-08-18T13:23:39.715+0000 [STG/0] ERR from /tmp/buildpacks/ec4877c1fdbf75e933d700b041e99f30/lib/ruby/add_java.rb:103:in `<main>'
2021-08-18T13:23:39.715+0000 [STG/0] OUT Configuration from /tmp/buildpacks/ec4877c1fdbf75e933d700b041e99f30/config/components.yml modified with: { jres: ["JavaBuildpack::Jre::SapMachineJRE"] }
2021-08-18T13:23:39.716+0000 [STG/0] ERR Failed to compile droplet: Failed to run finalize script: exit status 1
2021-08-18T13:23:39.722+0000 [STG/0] OUT Exit status 223

Regards,

Fabiano Rosa

View Entire Topic
harald_aamot
Discoverer
0 Kudos

Hi Fabiano and Thomas,
please note for the sap_java_buildpack: If you want to use the sapmachine11 JDK to run your app use:
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jdk.SAPMachineJDK']"
If you want to use the sapmachine11 JRE use:
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
Both also need:
JBP_CONFIG_SAP_MACHINE_JRE: '{ jre: { version: 11.+ } }'
to set sapmachine 11

Side note: The only reason I ever stumbled across that a JDK was necessary to run an app in cloud foundry was actually when ByteBuddy or another bytecode manipulation agent was used.