Giter Site home page Giter Site logo

sap-archive / com.sap.opensap.hana5.example Goto Github PK

View Code? Open in Web Editor NEW
89.0 46.0 81.0 2.79 MB

openSAP HANA5/HANA6 Course: Example Completed Implementation

Home Page: https://open.sap.com/courses/hana5/

License: Apache License 2.0

JavaScript 85.32% Java 1.37% HTML 12.70% CSS 0.62%

com.sap.opensap.hana5.example's Issues

no such package available : accept-language-parser

Hi, I'm having an issue on exercise: Exercise 5.1: Modules and Express. The moment i start running the core_js module, i get the error below. which is mainly about accept-language-parser, in which by right it should be able to see in the central repository. Is this an issue on xsa runtime or something else? I'm on hana2_sps2. Thanks!

[INFO] Injecting source code into builder...
[INFO] Source code injection finished
[INFO] ------------------------------------------------------------------------
npm ERR! Linux 3.12.67-60.64.24-default
npm ERR! argv "/hana/shared/H03/xs/app_working/appsrv13/executionroot/cbddfdb3-afc8-4d00-9b53-83bcd25188d3/app/META-INF/resources/nodejs/vendor/node6.11/bin/node" "/hana/shared/H03/xs/app_working/appsrv13/executionroot/cbddfdb3-afc8-4d00-9b53-83bcd25188d3/app/META-INF/resources/nodejs/vendor/node6.11/lib/node_modules/npm/bin/npm-cli.js" "install" "--registry" "https://hostname.com:51040"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code E404

npm ERR! 404 no such package available : accept-language-parser
npm ERR! 404
npm ERR! 404 'accept-language-parser' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'core-js'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /hana/shared/H03/xs/app_working/appsrv13/executionroot/cbddfdb3-afc8-4d00-9b53-83bcd25188d3/app/META-INF/.sap_java_buildpack/tomcat/temp/builder/sap.nodejs/builds/build-6176383983240492414/core_js/npm-debug.log

outbound api return 500 response

Hi,
I use the demo to exploy outbound restful api by creating xsjs ,

but it return 500, any other configuration should be set
b0e8c22a-9e1a-11e7-9f62-fca48fe26934

Regarts,
June

$.hdb.getConnection() undefined

Hello everyone,

Im facing several issues trying to follow some of tutorial instructions, the first one im facing is this:
1.- Create a template.
2.- Add a new NodeJS Module.
3.- In file called: server.js there're this lines:

try{
  options = Object.assing(options, xsenv.getServices({hana : {tag: "hana"}});
}catch(error){
 console.log("[WARN] : " + error.message);
}

I always got this: "[WARN] : No service matches hana"

Also, i have created this "CreateCountry" function (as tutorial said) in country.xsjs file:

function createCountry(country){
 var conn = $.hdb.getConnection();
 //.... truncated ....
}

And i got this error running Node Application (tinyjs):

"500 Cannot read property 'getConnection' of undefined"

Can someone please, give me a tip ?

The predefined session variable cannot be set via SET command: XS_APPLICATIONUSER

Hello,

I am having the following issue, "

Error: the predefined session variable cannot be set via SET command: XS_APPLICATIONUSER"

When accessing an .xsodata endpoint in my nodeJS app hosted on CF, this is the server.js I am using:

`/eslint no-console: 0, no-unused-vars: 0/
"use strict";
/*
var xsjs = require("@sap/xsjs");
var xsenv = require("@sap/xsenv");
var xsHDBConn = require("@sap/hdbext");
const express = require('express');
const passport = require('passport');
const JWTStrategy = require('@sap/xssec').JWTStrategy;
var port = process.env.PORT || 3000;
var hanaconfig = xsenv.getServices({ hana: {tag: "hana"} }).hana;

const app = express();

const services = xsenv.getServices({ uaa:'my-xsuaa' });
xsHDBConn.middleware(hanaconfig);

passport.use(new JWTStrategy(services.uaa));

app.use(passport.initialize());

app.use(passport.authenticate('JWT', { session: false }));

var options = {
//anonymous : false, // remove to authenticate calls
redirectUrl : "/index.xsjs"
};

// configure HANA
try {
options = Object.assign(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);
*/

"use strict";
var https = require("https");
var xsenv = require("@sap/xsenv");
var port = process.env.PORT || 3000;
var server = require("http").createServer();
https.globalAgent.options.ca = xsenv.loadCertificates();
global.__base = __dirname + "/";

//Initialize Express App for XSA UAA and HDBEXT Middleware
var xsenv = require("@sap/xsenv");
var passport = require("passport");
var xssec = require("@sap/xssec");
var xsHDBConn = require("@sap/hdbext");
var express = require("express");

//logging
var logging = require("@sap/logging");
var appContext = logging.createAppContext();
var logger = appContext.getLogger("/Application");
var tracer = appContext.getTracer(__filename);

//Initialize Express App for XS UAA and HDBEXT Middleware
var app = express();

passport.use("JWT", new xssec.JWTStrategy(xsenv.getServices({
uaa: {
tag: "xsuaa"
}
}).uaa));
app.use(logging.expressMiddleware(appContext));
app.use(passport.initialize());
var hanaOptions = xsenv.getServices({
hana: {
tag: "hana"
}
});
//hanaOptions.hana.rowsWithMetadata = true;
app.use(
passport.authenticate("JWT", {
session: false
}),
xsHDBConn.middleware(hanaOptions.hana)
);

//Setup Routes
//var router = require("/lib")(app, server);

//Start the Server
server.on("request", app);
server.listen(port, function() {
console.info(Logger Level: ${logger.getLevel().toString()});
console.info(Logger Error Enabled: ${logger.isEnabled("error")});
console.info(Tracer Level: ${tracer.getLevel().toString()});
console.info(Tracer Error Enabled: ${tracer.isEnabled("error")});
logger.error(HTTP Server: ${server.address().port});
tracer.info(HTTP Server: ${server.address().port});
console.info(HTTP Server: ${server.address().port});
});`

This is my package.json

{ "dependencies": { "@sap/approuter": "^5.6.4", "@sap/xsenv": "1.2.9", "@sap/xsjs": "3.3.7", "@sap/xssec": "^2.1.15", "@sap/hdbext": "4.7.2", "@sap/hana-client": "~2.3", "express": "^4.16.3", "passport": "^0.4.0" }, "devDependencies": { "@sap/xsjs-test": "2.0.16" }, "files": [], "main": "server.js", "name": "NODE_JS_MODULE", "scripts": { "start": "node server.js", "test": "node testrun.js" }, "engines": { "node": "8.x" }, "version": "1.0.0" }
Anything I am missing? This only fails when I setup the authentication, without it it's possible to call the odata service without issues. I am also able to retrive user authentication scopes from simple JS endpoint s (with authentication on), only with .xsodata (and possible any DB accesses it fails)

Regards,

static port of module

Good morning!
I faced with problem - when you redeploy XSA application, for different module XSA assigns random ports. I need to assign static port to module. I saw documentation and I found there that in mta.yaml there is parameter port in scope of module, which I can use. As I understood It could help to solve issue.
xsa_issue
I put those parameter in mta.yaml in Parameters of module:
image
image

But When I run It - It fails with message in log:
"Unexpected type Double for option "port" of app "qs1svgEnowhBkHra-testPort-uiPort", expected Integer!"
xsa_issue_s

Do you know, is it possible to fix port in application?
And may be I make It wrong?

Internal SAP reference in settings files

The file httpclient.js contains a reference to an internal SAP server:

{path: "http://www.loc.gov/pictures/search/?fo=json&q=SAP&",
--
20 | host: "proxy.wdf.sap.corp",
21 | port: "8080",
22 | headers: {

Specifically, the server:

proxy.wdf.sap.corp

This artifact won't work outside the SAP firewall.

SAP Open Source runs regular scans looking for artifacts in the code which might indicate our internal code has accidentally released in to the Open Source stream. This file continues to show up in our scans. Can you please fix it, or remove it, so that it no longer shows up as an error?

Thank you.

WebIDE Debugger disconnected due to WebSocket Error

I'm doing the XSJS debugging exercise and inspecting the variables after an xsjs file operation is suspended by a debugger breakpoint. However, when I try to inspect the variables in the WebIDE console, the debugger will soon disconnect. Repeating the debugging process again and again consistently result in the debugger being disconnected. Checking on the chrome developer tools console, I can see some websocket error. Is this an issue on webide or on-premise hana?

system: HANA 2.0 SPS02

see screenshot below for reference:

image
image

Moving file cause "xs deploy" to fail

Hi,
I am using HANA Express 2.0 with web ide version 4.2.18.
I moved a file from one folder to another and while deploying to test space (xs deploy <mtar>) I got an error:

Merging... ok
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT Error: "calc.scenario://requestStatus": the object cannot be provided more than once [8212002]
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT "src/modelling/requestStatus.hdbcalculationview": the file would provide it
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT "src/requestStatus.hdbcalculationview": the deployed file already provides it
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT Error: "db://requestStatus": the object cannot be provided more than once [8212002]
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT "src/modelling/requestStatus.hdbcalculationview": the file would provide it
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT "src/requestStatus.hdbcalculationview": the deployed file already provides it
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT Error: "db://requestStatus/hier/requestStatus": the object cannot be provided more than once [8212002]
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT "src/modelling/requestStatus.hdbcalculationview": the file would provide it
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT "src/requestStatus.hdbcalculationview": the deployed file already provides it
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT Error: Calculating dependencies... failed [8212108]
3/9/18 6:49:23.421 AM [APP/2-1/deploy] OUT Error: Could not compose a consistent make graph [8212012]

But the build in development space using web-ide is fine.
Is there any way to deploy it, other than moving the file back to its original position?
Is it a possible bug which got fixed in later patches?

Regards,
Himanshu

Error: "db://gm2t" is required but not provided by any file

Hi Thomas,

great class, but i'm still struggling with exposing any data in views.

the full error console error dump:

12:17:03 PM (Builder) Build of /gm2p/gm2m started.
12:17:05 PM (DIBuild) Build of /gm2p/gm2m in progress
12:17:12 PM (DIBuild) ********** Printing /gm2p/gm2m Build Log **********
[INFO] Injecting source code into builder...
[INFO] Source code injection finished
[INFO] ------------------------------------------------------------------------
[email protected] node_modules/sap-hdi-deploy
├── [email protected]
├── [email protected] ([email protected], [email protected])
└── [email protected]

deploy@ start /hana/shared/HXE/xs/ea_data/vhcalhxedb/executionroot/194a7474-491c-4f94-948c-f4c3103f7ce5/app/tomcat/temp/builder/hdi-builder/builds/build-4577747085478011748/gm2m
node node_modules/sap-hdi-deploy/deploy.js

sap-hdi-deploy, version 2.0.0
Collecting files...
Collecting files... ok (0s 2ms)
Processing grants files...
Processing grants files... ok (0s 0ms)
Preprocessing files...
Preprocessing files... ok (0s 2ms)
Synchronizing files with the container "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER"...
4 modified or added files are scheduled for deploy
0 deleted files are scheduled for undeploy
Synchronizing files with the container "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER"... ok (0s 983ms)
Deploying to the container "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER"...
Starting make in the container "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER" with 4 files to deploy, 0 files to undeploy...
Migrating libraries...
Making...
No make necessary
Making... ok
Migrating libraries... ok
Making...
Preparing...
Preparing the make transaction...
Adding "src/admin.hdbrole" for deploy...
Adding "src/admin.hdbrole" for deploy... ok
Adding "src/gm2ap.hdbanalyticprivilege" for deploy...
Adding "src/gm2ap.hdbanalyticprivilege" for deploy... ok
Adding "src/gm2sp.hdbstructuredprivilege" for deploy...
Adding "src/gm2sp.hdbstructuredprivilege" for deploy... ok
Adding "src/gm2v.hdbcalculationview" for deploy...
Adding "src/gm2v.hdbcalculationview" for deploy... ok
Preparing... ok
Preparing the make transaction... ok
Checking the uniqueness of the catalog objects in the schema "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER"...
Checking the uniqueness of the catalog objects in the schema "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER"... ok
Calculating dependencies...
Expanding...
Expanding... ok
Precompiling...
Precompiling "src/admin.hdbrole"...
Precompiling "src/gm2ap.hdbanalyticprivilege"...
Precompiling "src/gm2sp.hdbstructuredprivilege"...
Precompiling "src/admin.hdbrole"... ok
Precompiling "src/gm2v.hdbcalculationview"...
Precompiling "src/gm2v.hdbcalculationview"... ok
Precompiling "src/gm2ap.hdbanalyticprivilege"... ok
Precompiling "src/gm2sp.hdbstructuredprivilege"... ok
Precompiling... ok
Merging...
Merging... ok
Error: Calculating dependencies... failed
Error: Make failed (1 errors, 0 warnings): tried to deploy 4 files (effective 4), undeploy 0 files (effective 0), redeploy 0 dependent files
Error: "db://gm2t" is required but not provided by any file
Error: Making... failed
Error: Starting make in the container "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER" with 4 files to deploy, 0 files to undeploy... failed
Error: Could not run make
Error: "db://gm2t" is required but not provided by any file
Deployment to container 7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER failed - error Error executing: CALL "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER#DI".MAKE(#DEPLOY, #UNDEPLOY, #FOLDERPRMS, #PRMS, ?, ?, ?); (nested message: HDI call failed) [Deployment ID: none].
Error: Error: Error executing: CALL "7QZP9UHWGMOQPQBN_GM2P_HDI_CONTAINER#DI".MAKE(#DEPLOY, #UNDEPLOY, #FOLDERPRMS, #PRMS, ?, ?, ?);
(nested message: HDI call failed)
(2s 822ms)

npm ERR! Linux 3.0.101-71-default
npm ERR! argv "/hana/shared/HXE/xs/ea_data/vhcalhxedb/executionroot/194a7474-491c-4f94-948c-f4c3103f7ce5/app/resources/nodejs/vendor/node4.4/bin/node" "/hana/shared/HXE/xs/ea_data/vhcalhxedb/executionroot/194a7474-491c-4f94-948c-f4c3103f7ce5/app/resources/nodejs/vendor/node4.4/lib/node_modules/npm/bin/npm-cli.js" "start"
npm ERR! node v4.4.6
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! deploy@ start: node node_modules/sap-hdi-deploy/deploy.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the deploy@ start script 'node node_modules/sap-hdi-deploy/deploy.js'.
npm ERR! This is most likely a problem with the deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/sap-hdi-deploy/deploy.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs deploy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls deploy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /hana/shared/HXE/xs/ea_data/vhcalhxedb/executionroot/194a7474-491c-4f94-948c-f4c3103f7ce5/app/tomcat/temp/builder/hdi-builder/builds/build-4577747085478011748/gm2m/npm-debug.log

********** End of /gm2p/gm2m Build Log **********
12:17:12 PM (Builder) Check console logs for details
12:17:12 PM (Builder) Build of /gm2p/gm2m failed.

the gm2 zip file is attached:
gm2p.zip

if you cannot support it, who can?

thx, greg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.