Skip to Content
0

SAP Web IDE for SAP HANA Build Error: more than one service definition found

Aug 03, 2017 at 01:54 PM

192

avatar image

I am stuck with exercise 2.5 of the Open SAP course Software Development on SAP HANA (Update Q4/2016).

In this exercise, first a user defined service to provide access to the SFLIGHT schema is defined with the command line interface:

xs cups CROSS_SCHEMA_SFLIGHT_00 -p "{\"host\":\"vhcalhexdb\",\"port\":\"30015\",\"user\":\"XSA_DEV\",\"password\":\"xxx\",\"driver\":\"com.sap.db.jdbc.Driver\",\"tags\":[\"hana\"] , \"schema\" :\"SFLIGHT\" }"

Then, this service is referenced with key hdi-sflight-service in the mta.yaml:

_schema-version: '2.0'
ID: openSAPHANA5
description: openSAP HANA5 Group 01
version: 0.0.1


modules:
- name: web
  type: html5
  path: web
  requires:
      - name: openSAPHANA5_00-uaa
      
- name: core-db
  type: hdb
  path: core-db
  requires:
   - name: hdi-container
     properties:
        target-container: ~{hdi-container-name}
   - name: CrossSchemaService
     group: SERVICE_REPLACEMENTS
     properties:
       key: hdi-sflight-service
       service: ~{sflight-service-name} 

resources:
  - name: openSAPHANA5_00-uaa
    type: com.sap.xs.uaa
    parameters:
      config_path: ./xs-security.json 
  - name: hdi-container
    properties:
       hdi-container-name: ${service-name}
    type: com.sap.xs.hdi-container
  - name: CrossSchemaService
    type: org.cloudfoundry.existing-service
    parameters:
      service-name: CROSS_SCHEMA_SFLIGHT_00
    properties:
      sflight-service-name: ${service-name}


I reference this service key in SFLIGHT.hdbgrants

{
  "hdi-sflight-service": {
    "object_owner" : {
      "schema_privileges":[ 
        { 
          "reference":"SFLIGHT",
          "privileges_with_grant_option":["SELECT", "SELECT METADATA"]
        }
      ]
    },
    "application_user" : {
      "schema_privileges":[ 
        { 
          "reference":"SFLIGHT",
          "privileges_with_grant_option":["SELECT", "SELECT METADATA"]
        }
      ]
    }
  }
}

When I build, I get the error:

Error: more than one service definition found

Any help would be appreciated.

Thanks!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Thomas Jung
Aug 04, 2017 at 12:41 PM
0

That error tells me that you missed step 9 in exercise 2.1.

An HDB module can also have more than one database resource associated with it. However it can only have one primary resouce which is the target for all database development objects it will create. Later we will add more resources for cross container access. This requires us to set this resources as the TARGET_CONTAINER in order to describe it as the primary database resource for this module.
properties:
TARGET_CONTAINER: ~{hdi-container-name}
Save the mta.yaml file.

Check the definition of core_db module and make sure you have properly set the TARGET_CONTAINER. This tells the system which of the two DB connections you want to be the primary connection of HDI deployment. This error is telling you that you have more than one service definition as a requirement for the module and it doesn't know which one should be primary.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Ah, strange. I do not know, why I wrote target-container instead of TARGET_CONTAINER, but I certainly did not invent this myself....

Anyway, thanks a lot!

0