2020 Jun 12 1:29 AM
Unable to parse xsodata file for Tiny world tutorial. Can someone help here?
I'm able to build and run my application - I get "Hello World", but unable to read the data. The tables and models exist.
Here is my service - euro.xsodata
service {
“tinyworld.tinydb::myview” as “euro” keys generate local “ID”;
}
mta.yaml - this builds and runs (node.js application)
ID: tinyworld
_schema-version: '2.1'
version: 0.0.1
modules:
- name: tinydb
type: hdb
path: tinydb
requires:
- name: hdi_tinydb
- name: tinyjs
type: nodejs
path: tinyjs
requires:
- name: tinydb
- name: hdi_tinydb
provides:
- name: tinyjs_api
properties:
sevice_url: ${default-url}
- name: tinyui
type: html5
path: tinyui
resources:
- name: hdi_tinydb
properties:
hdi-container-name: ${service-name}
type: com.sap.xs.hdi-containe
server.js
/*eslint no-console: 0, no-unused-vars: 0*/
"use strict";
var xsjs = require("@sap/xsjs");
var xsenv = require("@sap/xsenv");
var port = process.env.PORT || 3000;
let options = {
anonymous : true, // remove to authenticate calls
auditLog : { logToConsole: true }, // change to auditlog service for productive scenarios
redirectUrl : "/index.xsjs"
};
// configure HANA
try {
options = Object.assign(options, xsenv.getServices({ hana: {tag: "hana"} }));
// options = xsjs.extend(options, xsenv.getServices({ hana: {tag: “hana”} }));
} catch (err) {
console.log("[WARN]", err.message);
}
// configure UAA
try {
options = Object.assign(options, xsenv.getServices({ uaa: {tag: "xsuaa"} }));
} catch (err) {
console.log("[WARN]", err.message);
}
// start server
xsjs(options).listen(port);
console.log("Server listening on port %d", port);
error message
{error:
{code: "500",
message:
{lang: "en-US",
value: "Error while parsing xsodata file."
}
}
}
2021 Mar 05 11:50 AM
I am also getting same issue. Is this issue resolved/. If yes can you please tell me what changes you made in code?
2021 Mar 30 9:58 AM
Hi,
I faced similar issue. Restarting the nodeJS module worked for me.
Regards,
Sayeeda