javascripthanahana-xshana-studioxsjs

Not able to run xsjs file, error: site can't be reached


I am using office network to learn SAP HANA, to connect to HANA system I have to first connect to VPN then only the HANA system gets online. I configured a simple project XS application but when I try to run it, it shows the below error :

hana01’s server DNS address could not be found. enter image description here

The URL which gets generated is https://hana01:4300/SampleXSapp/main.xsjs

I have no idea from where it is picking up "hana01:4300"

The online tutorial had port 8000 for running it

If I disconnect from VPN, then my HANA system goes down and the icon changes to gray from green.

I am attaching files and screenshot in case, you may check it what is wrong with any piece of code. Also please tell me if I had to make some changes in the Network to resolve this particular error.

My file main.xsjs:

$.response.contentType = "text/html";
var output;
output = "Hello World! This is a demo of simple SAP HANA Extended Services Application. Stay tuned to learn more.";
$.response.setBody(output);

My .xsaccess file:

{
     "exposed" : true,  
     "authentication" :  [{ "method": "Basic" }]
}

.xsapp file has no content.

My HANA System:

enter image description here

enter image description here

enter image description here

I made same program in HANA Cloud platform there I can run my system, enter image description here

Please advice on how to get this resolved, thanks in advance.


Solution

  • In HANA Studio, if you right click on the connection name (H01), then hit "Properties", you will see the address used for the XS engine under "XS Properties". This is the address used when you hit the run button in HANA Studio from what I understood. I recommend you to change it with the IP address (172.30.170.00), as you might not have "HANA01" mapped properly in your host file.

    The port 4300 is the default one used for HTTPS when your instance id is 00, which is your case. And HTTP is 8000.

    But this is for HANA XS Classic as XS Advanced uses different ports.

    You can always adapt the URL address generated while running you xsjs file from HANA Studio and the get the proper one to fix the "XS Properties".

    Hope this helps