Rest API installation


I would like to use the rest tango API to develop a web GUI (with Ada Web Server) for a project using tango.
To test the possibility, I installed Tango's 9.3.4 package on a Debian buster. It seems to be ok for most applications (jive, pogo, astor) but not for tangorestserver. There is a java version problem. Version 1.8.x is too old. So I changed in the TangoRestServer bash to a newer version (version 11) and it seems to work.
I followed the explanations given on the link by creating a device server with jive then I ran "TangoRestServer test" and I got the following answer:
WARN 2021-02-02 11:36:26,772 [main - - o.t.c.d.Database] org.tango.client.database.Database.<init>:41 - database cache version release 1.13 not supported, please install it to have better performance
INFO 2021-02-02 11:36:26,929 [main - test/rest/0 - o.t.TangoRestServer] org.tango.TangoRestServer.init:145 - Initializing TangoRestServer device…
WARN 2021-02-02 11:36:26,940 [main - test/rest/0 - o.t.s.e.EventManager] - CtrlSystem/EventBufferHwm property is not a number:
INFO 2021-02-02 11:36:27,025 [main - test/rest/0 - o.t.s.ServerManager] org.tango.server.ServerManager.init:265 - TANGO server TangoRestServer/test started
WARN 2021-02-02 11:36:27,026 [main - test/rest/0 - o.t.s.ServerManagerUtils] org.tango.server.ServerManagerUtils.dumpPID:47 - Failed to create pid file /var/tmp/TangoRestServer/ due to java.nio.file.NoSuchFileException:
Exception in thread "main" java.lang.RuntimeException: java.nio.file.NoSuchFileException: /var/tmp/TangoRestServer/tomcat_4274159224536421215
at org.tango.web.server.tomcat.TomcatBootstrap.initializeBaseDir(
at org.tango.TangoRestServer.startTomcat(
at org.tango.TangoRestServer.main(
Caused by: java.nio.file.NoSuchFileException: /var/tmp/TangoRestServer/tomcat_4274159224536421215
at java.base/sun.nio.fs.UnixException.translateToIOException(
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(
at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(
at java.base/java.nio.file.Files.createDirectory(
at java.base/java.nio.file.TempFileHelper.create(
at java.base/java.nio.file.TempFileHelper.createTempDirectory(
at java.base/java.nio.file.Files.createTempDirectory(
at org.tango.web.server.tomcat.TomcatBootstrap.initializeBaseDir(
… 2 more

I then run the following command in another terminal :

curl -u "tango-cs: tango" http: // localhost: 10001 / tango / rest

and I have the following answer:

curl: (7) Failed to connect to localhost port 10001: Connection refused

What did I do wrong or forget?

Thanks for the answer
Looks like your instance of TangoRestServer does not have permissions to create a temporary file/dir, which is required for proper running. Another reason could be insufficient space. Please check those issues. Thanks
For your convenience I have updated the wiki page of the rest-server.


The rights are 777 and there is enough space
It looks like it's good. It was just the TangoRestServer directory (LOG_HOME environment variable from the TangoRestServer bash) which was not created in the /var /tmp directory. I continue !!!!
Register or login to create to post a reply.