简体   繁体   English

SAP Cloud Platform通过CF CLI部署MTAR

[英]SAP Cloud Platform Deploy MTAR via CF CLI

We had a demo MTA running on SAP Cloud Foundry. 我们在SAP Cloud Foundry上运行了一个演示MTA。 This MTA was build via the mta_archive_builder tool provided by SAP and deployed via the CF CLI. 此MTA是通过SAP提供的mta_archive_builder工具构建的,并通过CF CLI进行部署。 Now, about a year later, we want to update this MTA, nothing major, just a properties update. 现在,大约一年后,我们想要更新这个MTA,没什么大不了的,只是一个属性更新。

Before I tried building and deploying anything, I upgraded all the required tools. 在我尝试构建和部署任何内容之前,我升级了所有必需的工具。

The MTA builds just fine, but when deploying the MTAR, the upload of our java application(s) fails. MTA构建得很好,但是在部署MTAR时,我们的java应用程序的上传失败了。 The logs states that the environment expects some ZIP file. 日志声明环境需要一些ZIP文件。 The mtar archive only holds .jar files, should those be ZIP's? mtar存档只保存.jar文件,那些文件应该是ZIP吗? If so, how? 如果是这样,怎么样?

I already tried using the new MTA builder, without any luck. 我已经尝试过使用新的MTA构建器,没有任何运气。 The same problem occurs. 出现同样的问题。

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

Important log entry: 重要日志条目:

#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"
    ]
  }
}"#

The question has been answered on the SAP Community, you can find the answer here: https://answers.sap.com/questions/12705200/deploy-mtar-via-cf-cli.html 问题已在SAP社区得到解答,您可以在此处找到答案: https//answers.sap.com/questions/12705200/deploy-mtar-via-cf-cli.html

Basically one of the tools creates faulty jar files within the .mtar archive. 基本上,其中一个工具会在.mtar存档中创建错误的jar文件。 The solution is to unpack the mtar, fix the jar archives with the command "zip -FF" and repack them into the .mtar archive. 解决方案是解压缩mtar,使用命令“zip -FF”修复jar存档,并将它们重新打包到.mtar存档中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM