Every device has a black-box which registers all the calls the device receive. There is a method in the DeviceProxy
class allowing a client to get the content of this black-box. But may be it is not important and does not need to be seen in the RESTfull API
The call set_attribute_config() allows a client to set the attribute configuration (its modifiable part). For instance, this
allows a client to change the alarm threshold or the attribute label or …
This is what ATKpanel is using when you click on the button labelled with … close to attribute value display
The history related calls (read_attribute_history or command_inout_history) are when your attribute (or command) is polled. In this case, you have a buffer for each polled
object managed as a round-robin buffer. These calls allow the user to retrieve this buffer content (therefore a brief history of the attribute value). Could be useful in a trend window for instance.
The write_read_attribute(s) calls is something like a write_attribute(s) followed by a read_attribute(s) on a device in a
single call. If you use the default device serialisation mode, it is atomic (not the case if you do a write followed by a
read)
For now we can just say that this must be visible in an admin panel (I suppose every implementation of the API provides one, where an authorized user can set implementation specific settings, like cache policy etc).
History related calls we can add in later releases, if there will a demand.
Let’s say that PUT is implementation depended, i.e. write_read or write then read.
Concerning w_value. For me it seems very hardware specific and I think we must leave it on the Tango level. Since we now develop a very high level API which may be used by completely new users with web development background, w_value is quite misleading.
From what I have understood client may always cache it’s own value. Consider this JS snippet:
This project is dedicated to API specification. So if you want to add something to the specification you are welcome to open a new enhancement. Here is an example of such issue.
Wiki itself is an repo so you can clone it and edit (perhaps you will need a bitbucket account to clone it). All the changes are visible, if you press history button in the right top corner.
Project itself will be a maven java project with compatibility tests. I plan to add some next week.
HTTP Status 500 - java.lang.NullPointerException
type Exception report
message java.lang.NullPointerException
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:247)
org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:149)
org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:432)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:376)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.tango.web.server.filters.SimpleCacheFilter.doFilter(SimpleCacheFilter.java:37)
org.tango.web.server.filters.TimeWatcher.doFilter(TimeWatcher.java:28)
root cause
java.lang.NullPointerException
org.tango.web.server.providers.AbstractCacheProvider.filter(AbstractCacheProvider.java:35)
org.jboss.resteasy.core.ServerResponseWriter.executeFilters(ServerResponseWriter.java:122)
org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:49)
org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:427)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:376)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.tango.web.server.filters.SimpleCacheFilter.doFilter(SimpleCacheFilter.java:37)
org.tango.web.server.filters.TimeWatcher.doFilter(TimeWatcher.java:28)
note The full stack trace of the root cause is available in the Apache Tomcat/8.0.33 logs.
Apache Tomcat/8.0.33
Thank you for reporting the problem. A ticket has been created: 101
Try to use rc2-0.3. I fixed some NPEs in the newer version. Hopefully these are the same.
If not I need more info. Could you please attach full Tomcat’s log and possibly log from your browser? For instance, in firefox there is a developer console which shows net activity. Does it happen all the time or just for a specific request? Basically I need context in which NPE is happening, i.e. request data, to investigate the problem
Hi Igor,
I tried the last release candidate. It looks like the WAR assumes that the Database server is sys/database/2. Is it possible to configure this value ?
At SOLEIL, our systems are deployed with database server named sys/database/dbds1 and sys/database/dbds2
thanks for your work and your help.
Greg
TRACE 09-05-2016 10:03:57 [localhost-startStop-1 - o.t.c.e.p.DeviceProxyWrapper] DeviceProxyWrapper(sys/database/2)
DEBUG 09-05-2016 10:03:57 [localhost-startStop-1 - o.t.c.e.p.DeviceProxyWrapper] Failed to construct DeviceProxyWrapper for device sys/database/2
ERROR 09-05-2016 10:03:57 [localhost-startStop-1 - o.t.w.s.Launcher] MTango has failed to initialize: sys/database/2:DB_DeviceNotDefined[device sys/database/2 not defined in the database calypso.synchrotron-soleil.fr:20001 !]
Yes, you are right - by default mtango uses “sys/database/2”. You can alter it providing “TANGO_DB” system property to your tomcat instance, e.g. -DTANGO_DB=sys/database/dbds1 in tomcat’s configuration file.
Now Tomcat starts without error messages. But when I request something like /mtango/rest/devices/tango/tangotest/titan/double_scalar/value I have this error:
INFO 10-05-2016 13:05:18 [http-nio-8844-exec-9 - o.t.w.s.f.TimeWatcher] Serving request. Stopwatch is active.
DEBUG 10-05-2016 13:05:18 [http-nio-8844-exec-9 - o.j.r.l.i.Slf4jLogger] PathInfo: /devices/tango/tangotest/titan/double_scalar/value
ERROR 10-05-2016 13:05:18 [http-nio-8844-exec-9 - o.j.r.l.i.Slf4jLogger] failed to execute
javax.ws.rs.NotFoundException: Could not find resource for full path: http://dev-el6-1.ica.synchrotron-soleil.fr:8844/mtango/rest/devices/tango/tangotest/titan/double_scalar/value
at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:112) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:444) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:234) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:171) ~[resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.7.Final.jar:na]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.7.Final.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [servlet-api.jar:na]
A new version of Tango REST API Specification has been released – RC3.
Most notable changes:
tango db is now a resource:
/tango/rest/rc3/hosts
– lists all known tango db hosts (initially only one, e.g. localhost:10000, filled in later when users access different tango hosts)
/tango/rest/rc3/hosts/{host}/{port}/devices
– lists all devices defined in tango://{host}:{port}/sys/database/2
Unfortunately this version is not backward compatible. One can use mtango.server-rc2-0.4 (download here) till new client libraries version will be released.