Skip to Content
avatar image
Former Member

MTA project format validation failed (absolute URL required)

Hello,

I created sample MTA project inside SAP Web IDE for SAP HANA. MTA project contains 2 modules: 'backend' and 'ui5'. 'ui5' module need to connect to 'backend' module, so 'mta.yaml' need to contain parameter.

Current 'mta.yaml` content:

ID: sampleMTA
_schema-version: '2.0'
version: 0.0.1
modules:
  - name: monitorBE
    type: nodejs
    path: monitorBE
    provides:
      - name: monitorBE_api
        properties:
          service_url: '${default-url}'
  - name: monitorUI
    type: html5
    path: monitorUI
    requires:
      - name: ui5-lib
        properties:
          ui5liburl: '~{url}'
      - name: monitorBE_api
        group: destinations
        properties:
          name: backend
          url: '{service_url}'
          forwardAuthToken: false
resources:
  - name: ui5-lib
    type: configuration
    parameters:
      provider-id: 'com.sap.ui5.dist.sapui5-dist-xsa.XSAC_UI5_FESV3:sapui5_fesv3'
      version: '>=1.44.8'

Inside 'monitorUI\xs-app.json' file I add a destination:

{
  "welcomeFile": "webapp/index.html",
  "authenticationMethod": "none",
  "routes": [{
    "source": "^/backend/.*$",
    "destination": "backend",
    "csrfProtection": false,
    "authenticationType": "none"
  }, {
    "source": "/(.*)",
    "localDir": "resources",
    "authenticationType": "none",
    "replace": {
      "pathSuffixes": ["index.html"],
      "vars": ["ui5liburl"]
    }
  }]
}

When I start module 'monitorBE' , WebIDE shows that it runs well and I can get response from it. Next I manually start 'monitorUI' module but I've got an error:

12/22/17 1:42:06.806 PM [APP/12-0] ERR
12/22/17 1:42:06.808 PM [APP/12-0] ERR    /hana/shared/HS1/xs/app_working/lu384321.wdf.sap.corp/executionroot/c73da174-8b6b-4599-a777-8b8625432984/app/node_modules/@sap/approuter/lib/utils/JsonValidator.js:30
12/22/17 1:42:06.808 PM [APP/12-0] ERR        throw new VError('%s%s: %s',
12/22/17 1:42:06.808 PM [APP/12-0] ERR        ^
12/22/17 1:42:06.808 PM [APP/12-0] ERR    VError: environment-destinations/0/url: Format validation failed (URI must be absolute)
12/22/17 1:42:06.808 PM [APP/12-0] ERR        at JsonValidator.validate (/hana/shared/HS1/xs/app_working/lu384321.wdf.sap.corp/executionroot/c73da174-8b6b-4599-a777-8b8625432984/app/node_modules/@sap/approuter/lib/utils/JsonValidator.js:30:11)
.....

If possible can someone explain, what was wrong and how to fix this?

  • How can I get a 'offending' "non-absolute URI" value?
  • What file fails validation? I suppose it is 'monitorUI\xs-apps.json' but I'm not sure.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 22, 2017 at 09:27 AM

    Hi Dimitry,

    try following changed line (with ~)

    url: '~{service_url}'

    BR, HP

    Add comment
    10|10000 characters needed characters exceeded