cancel
Showing results for 
Search instead for 
Did you mean: 

CAP MTA Deployment with launchpad service

former_member743968
Participant
0 Kudos

Tutorials: https://developers.sap.com/tutorials/btp-app-launchpad-service.html
--------------------------

On step 13, MTA re-deployment - I am receiving an error that my Resource object is null. Any ideas on how to troubleshoot?

Error resolving merged descriptor properties and parameters: Cannot invoke "org.cloudfoundry.multiapps.mta.model.Resource.getProperties()" because "resource" is null 
Process failed.
manjunath_ks1
Employee
Employee
0 Kudos

Hi austinkloske ,

It might be a formatting issue with respect to white space, could you share your mta.yml file?

Best Regards,
Manjunath

julian_cely14
Member
0 Kudos

Hello, I'm facing the same problem, were you able to find a solution ?

Here is my mta.yaml file :

ID: securitychecks
_schema-version: "3.2"
version: 2.2.2
modules:
  - name: securitychecks-dest-content
    type: com.sap.application.content
    requires:
      - name: securitychecks-dest-srv
        parameters:
          content-target: true
      - name: securitychecks-repo-host
        parameters:
          service-key:
            name: securitychecks-repo-host-key
      - name: securitychecks-uaa
        parameters:
          service-key:
            name: securitychecks-uaa-key
    parameters:
      content:
        instance:
          destinations:
            - Name: securitychecks_repo_host
              ServiceInstanceName: securitychecks-html5-srv
              ServiceKeyName: securitychecks-repo-host-key
              sap.cloud.service: securitychecks
            - Authentication: OAuth2UserTokenExchange
              Name: securitychecks_uaa
              ServiceInstanceName: securitychecks-xsuaa-srv
              ServiceKeyName: securitychecks-uaa-key
              sap.cloud.service: securitychecks
          existing_destinations_policy: ignore
    build-parameters:
      no-source: true
  - name: securitychecks-app-content
    type: com.sap.application.content
    path: .
    requires:
      - name: securitychecks-repo-host
        parameters:
          content-target: true
    build-parameters:
      build-result: resources
      requires:
        - artifacts:
            - securitychecks.zip
          name: securitychecks
          target-path: resources/
  - name: securitychecks-srv
    type: nodejs
    path: srv
    parameters:
      memory: 256M
      disk-quota: 512M
    provides:
      - name: srv_api
        properties:
          url: ${default-url}
    properties:
      SAP_JWT_TRUST_ACL:
        - clientid: "*"
          identityzone: "sap-provisioning"
    requires:
      - name: securitychecks-uaa
      - name: securitychecks-registry
  - name: securitychecks
    type: html5
    path: .
    build-parameters:
      build-result: dist
      builder: custom
      commands:
      - npm install
      supported-platforms: []
    parameters:
      memory: 256M
      disk-quota: 512M
    provides:
      - name: app_api
        properties:
          url: ${default-url}
          application: ${app-name}
    properties:
      TENANT_HOST_PATTERN: '^(.*)-${space}-${app-name}.${default-domain}'
    requires:
      - name: securitychecks-uaa
      - name: srv_api
        group: destinations
        properties:
          name: srv
          url: ~{url}
          forwardAuthToken: true
resources:
  - name: securitychecks-dest-srv
    type: org.cloudfoundry.managed-service
    parameters:
      config:
        HTML5Runtime_enabled: true
        init_data:
          instance:
            destinations:
              - Authentication: NoAuthentication
                Name: ui5
                ProxyType: Internet
                Type: HTTP
                URL: https://ui5.sap.com
            existing_destinations_policy: update
        version: 1.0.0
      service: destination
      service-name: securitychecks-dest-srv
      service-plan: lite
  - name: securitychecks-uaa
    type: org.cloudfoundry.managed-service
    requires: 
      - name: app_api
    properties:
      XSAPPNAME: ${xsuaa-app}
    parameters:
      path: ./xs-security.json
      service: xsuaa
      service-name: securitychecks-xsuaa-srv
      service-plan: application
      xsuaa-app: ~{app_api/application}
      config:
        xsappname: ${xsuaa-app}
  - name: securitychecks-repo-host
    type: org.cloudfoundry.managed-service
    parameters:
      service: html5-apps-repo
      service-name: securitychecks-html5-srv
      service-plan: app-host
  - name: securitychecks-registry
    type: org.cloudfoundry.managed-service
    requires:
      - name: securitychecks-uaa
    parameters:
      service: saas-registry
      service-plan: application
      service-name: securitychecks-registry
      config:
        xsappname: ~{securitychecks-uaa/XSAPPNAME}
        appName: securitychecks
        displayName: "Security Checks"
        description: "Security Checks SaaS App"
        category: "Ovee SaaS Applications"
        appUrls:
          onSubscription: https://${org}-${space}-securitychecks-srv.${default-domain}/callback/v1.0/tenants/{tenantId}
View Entire Topic
jlongie
Advisor
Advisor

Ok! Solution found, this is an issue I havent seen before. Here are the steps to solve it;

1. mta.yaml

Update the supported-platforms: [] to supported-platforms: [CF] inside the securitychecks module

2. Update securitychecks_ui_deployer -> package.json to the following so that it works with the latest nodejs versions, might not be applicable to you

{
"name": "approuterUIDeployer",
"dependencies": {
"@sap/html5-app-deployer": "4.1.0"
},
"scripts": {
"start": "node node_modules/@sap/html5-app-deployer/index.js"
}
}

I’ve also created a package.json that you can run cli commands. You can drop this into the root of your project folder;

{
"name": "securitychecks-project",
"version": "0.0.1",
"description": "Build and deployment scripts",
"scripts": {
"clean": "rimraf resources mta_archives mta-op* Makefile_*",
"build": "rimraf resources mta_archives && mbt build --mtar archive",
"deploy": "cf deploy mta_archives/archive.mtar --retries 1",
"undeploy": "cf undeploy securitychecks --delete-services --delete-service-keys"
},
"devDependencies": {
"mbt": "^1.0.15",
"rimraf": "3.0.0"
}
}

So you can now run the following commands;

npm i
npm run build
npm run deploy
npm run undeploy