SAP Cloud Platform通过CF CLI部署MTAR

时间:2019-06-11 09:52:51

标签: sap cloudfoundry sap-cloud-platform

我们在SAP Cloud Foundry上运行了一个演示MTA。该MTA是通过SAP提供的mta_archive_builder工具构建的,并通过CF CLI进行了部署。现在,大约一年后,我们要更新此MTA,没有什么大不了的,仅是属性更新。

在尝试构建和部署任何东西之前,我已经升级了所有必需的工具。

MTA构建良好,但是在部署MTAR时,我们的Java应用程序的上传失败。日志指出环境需要一些ZIP文件。 mtar存档仅包含.jar文件,这些文件应该是ZIP的吗?如果可以,怎么办?

我已经尝试使用新的MTA构建器,但没有任何运气。发生同样的问题。

cf.exe version 6.45.0+5f9ff16f9.2019-06-03

Listing installed plugins...


plugin      version   command name                 command help
multiapps   2.1.1     bg-deploy                    Deploy a multi-target app using blue-green deployment
multiapps   2.1.1     deploy                       Deploy a new multi-target app or sync changes to an existing one
multiapps   2.1.1     download-mta-op-logs, dmol   Download logs of multi-target app operation
multiapps   2.1.1     mta                          Display health and status for a multi-target app
multiapps   2.1.1     mta-ops                      List multi-target app operations
multiapps   2.1.1     mtas                         List all multi-target apps
multiapps   2.1.1     purge-mta-config             Purge no longer valid configuration entries
multiapps   2.1.1     undeploy                     Undeploy a multi-target app
mta_archive_builder version 1.1.19

  - name: ovinto
    type: java
    path: workspace/ovinto
    parameters:
      memory: 2048M
      disk-quota: 512M
      health-check-type: process
    provides:
      - name: ovinto_api
        properties:
          url: '${default-url}'
    properties:
      SPRING_PROFILES_ACTIVE: sapcloudfoundry
    build-parameters:
      builder: maven
      maven-opts:
        command: [ clean, verify ]
        profiles:
           - sapcf
        defines:
           skipTests: true
      build-result: target/*.jar

重要的日志条目:

#2.0#2019 06 06 13:06:36.042#Z#DEBUG#com.sap.cloud.lm.sl.xs2.76178077.MAIN_LOG.uploadAppTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-3###
[UploadAppStep] Error uploading application "ovinto". [failed] "{
  "response_code": "422",
  "response_body": "{\"description\":\"The request is semantically invalid: bits uploaded is not a valid zip file\"}",
  "response": {
    "date": [
      "Thu, 06 Jun 2019 13:06:27 GMT"
    ],
    "content-length": [
      "92"
    ],
    "content-type": [
      "text/plain; charset=utf-8"
    ],
    "connection": [
      "close"
    ]
  }
}"#

1 个答案:

答案 0 :(得分:0)

问题已在SAP社区中得到解答,您可以在此处找到答案: https://answers.sap.com/questions/12705200/deploy-mtar-via-cf-cli.html

基本上,其中一种工具会在.mtar存档中创建错误的jar文件。解决方案是解压mtar,使用命令“ zip -FF”修复jar存档,然后将其重新打包到.mtar存档中。