Giter VIP home page Giter VIP logo

agile-core's Introduction

Agile core components

This repository contains the alpha version of the following AGILE components:

Prerequisites

For the compilation, the following packages needs to be installed:

  • gettext git cmake

A java 8 compatible JDK and maven (mvn) must be already available in the system.

JAVA_HOME must be set for compilation to work.

Agile Protocol Manager

Exposes the org.eclipse.agail.ProtocolManager interface

  • DBus interface name org.eclipse.agail.ProtocolManager
  • DBus interface path /org/eclipse/agail/ProtocolManager

Example

The package org.eclipse.agail.protocolmanager.example contains an example file (i.e BLEDeviceDiscovery.java) to demonstrate the use of AGILE Protocol Manager to discover BLE devices through DBus interface.

AGILE Device Manager

Exposes the org.eclipse.agail.DeviceManager interface

  • DBus interface name org.eclipse.agail.DeviceManger
  • DBus interface path /org/eclipse/agail/DeviceManager

Example

Register BLE Device The package org.eclipse.agail.devicemanager.example contains an example file (i.e RegisterDevice.java) to demonstrate the usage of Agile Device Manager for device registration and creation of DBus interface for the registered device

Additional interfaces

  • org.eclipse.agail.Device
    • DBus interface base name org.eclipse.agail.device.[device name]

    • DBus interface base path /org/eclipse/agail/Device/[device name]

      Example

      • Connect BLE Device(TI SensorTag): The ConnectDevice.java file in org.eclipse.agail.devicemanager.example package demonstrates the usage of Agile org.eclipse.agail.Device Dbus interface to connect a TI SensorTag device.
      • Read Data: The ReadData.java file in org.eclipse.agail.devicemanager.example package demonstrates the usage of org.eclipse.agail.Device DBus interface in order to read temperature data from TI SensorTag temperature sensor/service.

AGILE Device Factory

Exposes the org.eclipse.agail.DeviceFactory interface

  • DBus interface name org.eclipse.agail.DeviceFactory
  • DBus interface path /org/eclipse/agail/DeviceFactory

The DeviceFactory can also load device implementation from a plugin folder. This plugin folder should be part of the classpath and also specified as the first parameter to the DeviceFactory. Class files with device implementation must implement the org.eclipse.egail.Device interface, and should be placed directly in the org.eclipse.agail.device.instance package. Class files must be placed in the plugin folder structured in a folder hierarchy corresponding to the package, i.e. the usual Java way: /org/eclipse/agail/device/instance/MyNewAgileDevice.class.

HTTP API

The DBus API can be used from the HTTP endpoint exposed by default on port 8080.

See the HTTP API reference for details on the exposed endpoints.

To query the endpoint, we suggest using Postman by importing the swagger based API definition

Launching the API

Under the scripts directory you can find different scripts to setup and start / stop the modules.

  • ./scripts/start.sh will install (if not available) all the dependencies required to run and start the modules.

    To control which component to start:

    • ./scripts/start.sh ProtocolManager starts only the Protocol Manager module
    • ./scripts/start.sh DeviceManager starts only the Device Manager module
    • ./scripts/start.sh http starts only the HTTP API module
  • ./scripts/stop.sh will kill all the modules.

    To control which component to stop (based on pkill -f pattern):

    • ./scripts/stop.sh protocolmanager stop only the Protocol Manager module
    • ./scripts/stop.sh devicemanager stop only the Device Manager module
    • ./scripts/stop.sh http stop only the HTTP API module
  • ./scripts/install-deps.sh is used to setup all the java and native dependencies to a local directory (placed in the ./deps folder)

agile-core's People

Contributors

cskiraly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

agile-core's Issues

error running test/sensortag-register.py

because I'm not sure if my device create post call contains the correct values, I tried to run the register test.

It finds the device but cannot create it over Dbus.

ERROR:dbus.connection:Unable to set arguments ((dbus.String(u'B0:B4:48:BE:7D:83'), dbus.String(u'iot.agile.protocol.BLE'), dbus.String(u'CC2650 SensorTag'), '', [('Temperature', 'celsius')]),) according to signature u'(ssssssa(ss))': <type 'exceptions.TypeError'>: Expected a string or unicode object
Traceback (most recent call last):
File "/home/pirate/agile-pi-core/test/sensortag-register.py", line 44, in
sensortag = device_manager.Create((device[0], device[1], device[2], '',[('Temperature','celsius')]))
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 70, in call
return self._proxy_method(_args, *_keywords)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 145, in call
**keywords)
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 641, in call_blocking
message.append(signature=signature, *args)
TypeError: Expected a string or unicode object

Discovery status read fails on Dummy protocol

When I try to get status of discovery I get a 500 error

curl -X GET "http://localhost:8080/api/protocols/discovery"
{"code":"INTERNAL_SERVER_ERROR","message":"The name iot.agile.protocol.Dummy was not provided by any .service files"}

2:56:18.696 [Thread-2] INFO i.a.p.ProtocolManagerImp - discovery status
22:56:18.710 [qtp1164175787-26] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.DBus$Error$ServiceUnknown: The name iot.agile.protocol.Dummy was not provided by any .service files
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.freedesktop.dbus.Error.getException(Unknown Source)
at org.freedesktop.dbus.Error.throwException(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy35.DiscoveryStatus(Unknown Source)
at iot.agile.http.resource.ProtocolManager.DiscoveryStatus(ProtocolManager.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)

inconsistent error reading component data, device CONNECT handling

Sometimes I got the Error Executing Method iot.agile.Device.Read: null while executing the call: http://device:8080/api/device/bleB0B448BE7D83/Temperature

If I immediately do the create device post it will fail with a timeout.
The solution is to wait a few minutes, create the device again and than it works again.'

Logs of the start of the problem, first lines are ok (got few hundred interations above)

12:45:31.074 [qtp21942989-66] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:45:31.074 [qtp21942989-66] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:45:40.295 [qtp21942989-70] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:45:40.295 [qtp21942989-70] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:45:41.151 [qtp21942989-68] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:41.151 [qtp21942989-68] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:41.665 [qtp21942989-70] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:45:41.665 [qtp21942989-70] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:45:41.675 [qtp21942989-69] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:41.675 [qtp21942989-69] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:42.165 [qtp21942989-81] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:42.165 [qtp21942989-81] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:42.171 [qtp21942989-82] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:45:42.171 [qtp21942989-82] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:45:42.207 [qtp21942989-68] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.Device.Read: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.freedesktop.dbus.Error.getException(Unknown Source)
    at org.freedesktop.dbus.Error.throwException(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy55.Read(Unknown Source)
    at iot.agile.http.resource.Device.Read(Device.java:109)
    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
12:45:42.237 [qtp21942989-72] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.Device.Read: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.freedesktop.dbus.Error.getException(Unknown Source)
    at org.freedesktop.dbus.Error.throwException(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy55.Read(Unknown Source)
    at iot.agile.http.resource.Device.Read(Device.java:109)
    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
12:45:42.678 [qtp21942989-66] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:45:42.678 [qtp21942989-66] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:45:42.678 [qtp21942989-68] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:42.678 [qtp21942989-68] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:45:42.730 [qtp21942989-70] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.Device.Read: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.freedesktop.dbus.Error.getException(Unknown Source)
    at org.freedesktop.dbus.Error.throwException(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy55.Read(Unknown Source)
    at iot.agile.http.resource.Device.Read(Device.java:109)
    at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)

Logs of the solution
(You will see the first try of creating the device fail, then wait and the second try succeed)

12:45:54.782 [qtp21942989-72] DEBUG i.agile.http.resource.DeviceManager - Create new device B0:B4:48:C0:8F:03 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:45:54.782 [qtp21942989-72] DEBUG i.agile.http.resource.DeviceManager - Create new device B0:B4:48:C0:8F:03 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:45:54.783 [qtp21942989-72] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:45:54.783 [qtp21942989-72] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:46:14.795 [qtp21942989-72] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.DBus$Error$NoReply: No reply within specified time
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy54.Create(Unknown Source)
    at iot.agile.http.resource.DeviceManager.Create(DeviceManager.java:71)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
12:47:30.868 [qtp21942989-84] DEBUG i.agile.http.resource.DeviceManager - Create new device B0:B4:48:BE:7D:83 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:47:30.868 [qtp21942989-84] DEBUG i.agile.http.resource.DeviceManager - Create new device B0:B4:48:BE:7D:83 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:47:30.869 [qtp21942989-84] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:47:30.869 [qtp21942989-84] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:47:35.349 [qtp21942989-66] DEBUG i.agile.http.resource.DeviceManager - Create new device B0:B4:48:C0:8F:03 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:47:35.349 [qtp21942989-66] DEBUG i.agile.http.resource.DeviceManager - Create new device B0:B4:48:C0:8F:03 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:47:35.350 [qtp21942989-66] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:47:35.350 [qtp21942989-66] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:47:41.783 [qtp21942989-81] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:47:41.783 [qtp21942989-81] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
12:47:47.358 [qtp21942989-69] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:47:47.359 [qtp21942989-72] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:47:47.358 [qtp21942989-69] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:47:47.359 [qtp21942989-72] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:47:52.474 [qtp21942989-81] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:47:52.474 [qtp21942989-81] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
12:47:52.492 [qtp21942989-70] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83
12:47:52.492 [qtp21942989-70] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448BE7D83

More explicit registration errors

if posting to /api/devices/register and a device is already registered it throws a 500 internal service error it'd be nice if it returned an informative error message like Device already registered

Can't find type of device

There are cases where agile core loads the device class files but doesn't allow the devices to use the correct driver
nodriver

12:26:28.910 [main] DEBUG i.a.devicemanager.DeviceManagerImp - Started Device Manager
12:26:28.948 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Started Device Factory
12:26:28.967 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.DummyDevice
12:26:28.974 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded
12:26:28.975 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.WeightDevice
12:26:28.984 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded
12:26:28.997 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.MedicalDevice
12:26:29.011 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded
12:26:29.011 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.ActivityDevice
12:26:29.019 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded
12:26:29.019 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.HexiwearDevice
12:26:29.021 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded
12:26:29.032 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.TISensorTag
12:26:29.037 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded
12:26:29.037 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - Loaded ClassLoader, trying to load iot.agile.device.instance.BeuerBPM85
12:26:29.038 [main] DEBUG i.a.devicefactory.DeviceFactoryImp - The class was loaded

ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Trying to marshall to unconvertable type (from java.lang.String to 40).
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy44.MatchingDeviceTypes(Unknown Source)
at iot.agile.http.resource.DeviceManager.MatchingDeviceTypes(DeviceManager.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)
12:26:43.602 [qtp1164175787-27] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Trying to marshall to unconvertable type (from java.lang.String to 40).
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy44.MatchingDeviceTypes(Unknown Source)
at iot.agile.http.resource.DeviceManager.MatchingDeviceTypes(DeviceManager.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)
12:26:43.602 [qtp1164175787-11] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Trying to marshall to unconvertable type (from java.lang.String to 40).
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy44.MatchingDeviceTypes(Unknown Source)
at iot.agile.http.resource.DeviceManager.MatchingDeviceTypes(DeviceManager.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)

websocket stops sending data after a while

I found out that I need to be first connected with the socket and then subscribe, if I do it that way i get updates from my sensor, but after a while it stops.
If I check my pi I see a syslogd message.
I can only get it working again by restarting the containers.

Message from syslogd@agile-pi at Sep 16 14:09:53 ...
kernel:[ 2360.366538] unregister_netdevice: waiting for lo to become free. Usage count = 1

Can't register device due to error in MatchingDeviceTypes

From the device manager UI I can't get the combo with suggested device types to be populated, apparently due to an exception in DeviceManager#MatchingDeviceTypes(DeviceOverview overview). See stacktrace below.
This is with agile-stack v0.1.5 / [email protected]

agile-core       | 09:51:16.965 [qtp23325099-14] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
agile-core       | org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Trying to marshall to unconvertable type (from java.lang.String to 40).
agile-core       | 	at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
agile-core       | 	at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
agile-core       | 	at com.sun.proxy.$Proxy44.MatchingDeviceTypes(Unknown Source)
agile-core       | 	at iot.agile.http.resource.DeviceManager.MatchingDeviceTypes(DeviceManager.java:91)
agile-core       | 	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
agile-core       | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
agile-core       | 	at java.lang.reflect.Method.invoke(Method.java:498)
agile-core       | 	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
agile-core       | 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
agile-core       | 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
agile-core       | 	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
agile-core       | 	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
agile-core       | 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
agile-core       | 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
agile-core       | 	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
agile-core       | 	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
agile-core       | 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
agile-core       | 	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
agile-core       | 	at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
agile-core       | 	at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
agile-core       | 	at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
agile-core       | 	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
agile-core       | 	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
agile-core       | 	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
agile-core       | 	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
agile-core       | 	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
agile-core       | 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
agile-core       | 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
agile-core       | 	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
agile-core       | 	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
agile-core       | 	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
agile-core       | 	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
agile-core       | 	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
agile-core       | 	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
agile-core       | 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
agile-core       | 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
agile-core       | 	at org.eclipse.jetty.server.Server.handle(Server.java:524)
agile-core       | 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
agile-core       | 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
agile-core       | 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
agile-core       | 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
agile-core       | 	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
agile-core       | 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
agile-core       | 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
agile-core       | 	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
agile-core       | 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
agile-core       | 	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
agile-core       | 	at java.lang.Thread.run(Thread.java:745)

Possible to DDOS get component Data

I'm building a service that polls the device components on a regular interval.
During this I was looking on how realtime I could make the connection so I increased the polling frequency.
With 2 devices with one component (so 2 calls at the same time) I can get an update rate of 500ms

If I increase to 100ms It works for a short time until I get
ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: The maximum number of pending replies per connection has been reached

That is Expected, what isn't expected is that it will continue until I only receive errors (no more success calls)

ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.DBus$Error$NoReply: No reply within specified time

It would be better if I still received some updates and the rest would be dropped.

Or even better that the gateway would be smart enough to limit the polling to the device and returns a cached version if the frequency is to high.

Devices can't be deregistered - Devices keep showing up in Device Manager even after deleting them

D evices cannot be deregistered once they are registered
step 1: try to delete
curl -I -X DELETE "http://localhost:8080/api/devices/ble606405A295DA" -H "accept: application/json"
HTTP/1.1 204 No Content
Date: Sun, 10 Sep 2017 16:28:57 GMT
Powered-By: Agile
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization,Content-Type
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, HEAD
Access-Control-Max-Age: 3600
Server: Jetty(9.3.z-SNAPSHOT)

step 2: check for devices
curl -X GET http://localhost:8080/api/devices -H "accept: application/json"
[{"deviceId":"ble606405A295DA","address":"60:64:05:A2:95:DA","name":"H10S","description":"","protocol":"iot.agile.protocol.BLE","path":"/iot/agile/Device/ble606405A295DA","streams":[{"id":"Steps","unit":""},{"id":"HeartRate","unit":""},{"id":"StepsStored","unit":""}]}]

Agile core error
[Thread-3] INFO iot.agile.device.base.DeviceImp - Device disconnected ble606405A295DA
java.lang.NullPointerException
at org.freedesktop.dbus.ObjectTree.remove(Unknown Source)
at org.freedesktop.dbus.AbstractConnection.unExportObject(Unknown Source)
at iot.agile.devicemanager.DeviceManagerImp.Delete(DeviceManagerImp.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.freedesktop.dbus.AbstractConnection$1.run(Unknown Source)
at org.freedesktop.dbus.AbstractConnection$_workerthread.run(Unknown Source)
19:28:57.814 [Thread-4] ERROR i.a.devicemanager.DeviceManagerImp - Unable to delete device: ble606405A295DA

Error on GET `/device/{deviceId}/execute/{command}`

Hi,
due to the issue "Agile-IoT/agile-node-red-nodes#3" I tryed to use the http api directly but seems that the implementation is not complete.

If I try to execute a command the server cannot parse the body in order to create the args parameter (Map<String,Variant> args):

@POST
@Path("/execute/{command}")
public void Execute(@PathParam("id") String id, @PathParam("command") String command, Map<String,Variant> args) 

Have you any example of POST that allow this kind of invocations?

Regards

Agile core keeps returning 500 error whem polling for available BLE device

Agile core doesn't return available BLE devices.
Rebooting agile-ble only will not work. The only way to recover is to reboot agile core

19:27:04.467 [qtp1164175787-31] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.ProtocolManager:/iot/agile/ProtocolManager
19:27:04.474 [qtp1164175787-31] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.ProtocolManager.Devices: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.freedesktop.dbus.Error.getException(Unknown Source)
at org.freedesktop.dbus.Error.throwException(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
at com.sun.proxy.$Proxy35.Devices(Unknown Source)
at iot.agile.http.resource.ProtocolManager.Devices(ProtocolManager.java:70)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
at org.eclipse.jetty.server.Server.handle(Server.java:524)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.lang.Thread.run(Thread.java:748)

Can't delete device if not connected

Disconnect is called independent of the connection status. It fails, and thus blocks device deletion.

agile-core | 14:21:25.798 [Thread-3] ERROR i.a.devicemanager.DeviceManagerImp - Unable to delete device: bleA0E6F8B6F200
agile-core | iot.agile.exception.AgileNoResultException: BLE Device not connected: CC2650 SensorTag
agile-core | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
agile-core | at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
agile-core | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
agile-core | at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
agile-core | at org.freedesktop.dbus.Error.getException(Unknown Source)
agile-core | at org.freedesktop.dbus.Error.throwException(Unknown Source)
agile-core | at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
agile-core | at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
agile-core | at com.sun.proxy.$Proxy6.Stop(Unknown Source)
agile-core | at iot.agile.devicemanager.DeviceManagerImp.Delete(DeviceManagerImp.java:188)
agile-core | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
agile-core | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
agile-core | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
agile-core | at java.lang.reflect.Method.invoke(Method.java:498)
agile-core | at org.freedesktop.dbus.AbstractConnection$1.run(Unknown Source)
agile-core | at org.freedesktop.dbus.AbstractConnection$_workerthread.run(Unknown Source)

since latest commits error while posting device

Last week posting a new device went perfect.
Now I rebuild the dockers and i get the following error

{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Failed to construct outgoing method call: Trying to marshall to unconvertable type (from java.lang.String to 40)."
}

agile-core BLE fatal error

After consuming the API for registering new devices I got errors on the protocol endpoints:

"message": "The name iot.agile.protocol.BLE was not provided by any .service files"

After looking at the logs I found a fatal error in the agile-core-BLE

09:57:51.820` [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Found 1 new device(s)
10:00:20.289 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 5E-E8-AF-7C-1A-AD
10:00:20.291 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 5E:E8:AF:7C:1A:AD
10:00:20.293 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
10:00:20.295 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Found 1 new device(s)
10:09:22.251 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 7D-F8-94-B4-33-A2
10:09:22.252 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 7D:F8:94:B4:33:A2
10:09:22.254 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
10:09:22.256 [pool-53-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Found 1 new device(s)
10:09:38.636 [Thread-3] INFO  i.agile.protocol.ble.BLEProtocolImp - Started discovery of BLE devices
10:13:00.462 [Thread-3] INFO  i.agile.protocol.ble.BLEProtocolImp - Started discovery of BLE devices
10:13:02.885 [Thread-3] INFO  i.agile.protocol.ble.BLEProtocolImp - Connecting to BLE device B0:B4:48:C0:8F:03
10:13:08.437 [Thread-4] INFO  i.agile.protocol.ble.BLEProtocolImp - Connecting to BLE device B0:B4:48:BE:7D:83
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x62338f66, pid=16, tid=0x628ff460
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) Client VM (25.101-b13 mixed mode linux-arm )
# Problematic frame:
# C  [libgobject-2.0.so.0+0x26f66]  g_type_check_instance_is_fundamentally_a+0x1
#
# Core dump written. Default location: /usr/src/app/iot.agile.protocol.BLE/core or core.16
#
# An error report file with more information is saved as:
# /usr/src/app/iot.agile.protocol.BLE/hs_err_pid16.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

error in Protocols endpoints

I rebuild the docker today with the updates and got an error after start.

I use the perservice start script, after startup I try GET /api/protocols/discovery
(The other protocols endpoints also have this issue)
and receive a ProtocolManager error.

The logs from agile-core-ProtocolManager

After a restart the issue was gone

14:56:54.864 [qtp4099308-69] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.DBus$Error$ServiceUnknown: The name iot.agile.ProtocolManager was not provided by any .service files
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.freedesktop.dbus.Error.getException(Unknown Source)
    at org.freedesktop.dbus.Error.throwException(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy45.DiscoveryStatus(Unknown Source)
    at iot.agile.http.resource.ProtocolManager.DiscoveryStatus(ProtocolManager.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)

after connection loss device null errors

Im doing test with 2 Ti sensortag devices
Both are sending subscription messages to our server.
I block one of the tags BLE connection and i receive a devices:null error on api calls from that tag.
The device should be auto reconnected.

14:23:21.053 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:21.057 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.96
14:23:21.661 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:21.663 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.65625
14:23:22.066 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:22.068 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.64
14:23:22.230 [qtp13821883-28] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
14:23:22.230 [qtp13821883-28] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.Device:/iot/agile/Device/bleB0B448C08F03
14:23:22.234 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Subscribe to Optical
14:23:22.245 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - BLE Device not connected: CC2650 SensorTag
14:23:22.673 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:22.675 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.65625
14:23:23.011 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:23.013 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.32
14:23:23.618 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:23.620 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.65625
14:23:24.023 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:24.026 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 119.12
14:23:24.631 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:24.633 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.65625
14:23:25.036 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:25.038 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 119.28
14:23:25.643 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:25.646 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:26.048 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:26.052 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.64
14:23:26.656 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:26.660 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:27.061 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:27.074 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.48
14:23:27.668 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:27.671 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:28.006 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:28.008 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 119.12
14:23:28.681 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:28.685 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:29.018 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:29.021 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.8
14:23:29.694 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:29.696 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:30.031 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:30.034 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.48
14:23:30.706 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:30.708 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:31.043 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@dcefd4
14:23:31.046 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Optical value 118.48
14:23:31.719 [Thread-9] INFO  i.agile.protocol.ble.BLEProtocolImp - Notifiying iot.agile.protocol.ble.BLEProtocolImp$NewRecordNotification@1431e50
14:23:31.722 [Thread-3] INFO  i.a.devicemanager.device.DeviceImp - Device notification component Temperature value 24.625
14:23:31.753 [qtp13821883-31] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
14:23:31.753 [qtp13821883-31] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
14:23:31.766 [qtp13821883-31] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.DeviceManager.Devices: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.freedesktop.dbus.Error.getException(Unknown Source)
    at org.freedesktop.dbus.Error.throwException(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy56.Devices(Unknown Source)
    at iot.agile.http.resource.DeviceManager.Devices(DeviceManager.java:105)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)

instability when reading data

I've encountered some peculiarities when attempting to read from devices.

Case 1

Basically if you register a device and try read from it before it's registered, it throws an exception and then doesn't recover from. I've encountered this when running the UI.

The easiest way to test is run the agile-ui, register a device and then quickly navigate to the device page.

Case 2

If a device is registered (but not currently connected) and you issue a connection /devices/<id>/connection.

It then throws

agile-core_1  | Java HotSpot(TM) Client VM warning: You have loaded library /usr/src/app/deps/libunix-java.so which might have disabled stack guard. The VM will try to fix the stack guard now.
agile-core_1  | It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
agile-core_1  | Exception in thread "Sender" java.lang.NullPointerException
agile-core_1  | 	at org.freedesktop.dbus.AbstractConnection$_sender.run(Unknown Source)
agile-core_1  | 15:32:35.699 [qtp22223153-19] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
agile-core_1  | org.freedesktop.dbus.exceptions.DBusExecutionException: Message Failed to Send: Broken pipe

In this case it's also unable to delete and re-register the device so have to restart the server.

 javax.ws.rs.WebApplicationException: Error on deleting device

I register the device and then try register and then subscribe instead of just reading from the device.

I've done a some testing and the only way I can get to work fairly reliably is to do:

  1. register the device
  2. subscribe via websocket
  3. read values via ws || lastUpdate.

As far as I know you should be able to do a single read without subscribing right?

Could someone clarify the possible work flows and expected behaviour for connecting and reading from a device?

Container won't run

docker --version
Docker version 17.07.0-ce-rc3, build 665d244

Not sure if this is something with my set up. I'm running it on my local machine with agile-cli then other containers start fine but agile-core has the following errors.

# If you would like to submit a bug report, please visit:
#   http://www.azulsystems.com/support/
#
qemu: uncaught target signal 6 (Aborted) - core dumped
/usr/src/app/scripts/start.sh: line 110:    31 Aborted                 java -jar -Djava.library.path=deps iot.agile.ProtocolManager/target/protocol-manager-1.0-jar-with-dependencies.jar
/usr/src/app/scripts/start.sh: line 110:    41 Aborted                 java -jar -Djava.library.path=deps iot.agile.DeviceManager/target/device-manager-1.0-jar-with-dependencies.jar
OpenJDK Client VM warning: You have loaded library /usr/src/app/deps/libunix-java.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xf4e2bf94, pid=61, tid=0xe18b9460
#
# JRE version: OpenJDK Runtime Environment (8.0_121-b42) (build 1.8.0_121-b42)
# Java VM: OpenJDK Client VM (25.121-b42 mixed mode, Evaluation linux-aarch32 )
# Problematic frame:
# V  [libjvm.so+0x191f94]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid61.log
Compiled method (c1)   14523  125             java.util.HashMap::put (13 bytes)
 total in heap  [0xf2a408c8,0xf2a40b84] = 700
 relocation     [0xf2a40994,0xf2a409bc] = 40
 main code      [0xf2a409c0,0xf2a40aa0] = 224
 stub code      [0xf2a40aa0,0xf2a40b04] = 100
 metadata       [0xf2a40b04,0xf2a40b14] = 16
 scopes data    [0xf2a40b14,0xf2a40b40] = 44
 scopes pcs     [0xf2a40b40,0xf2a40b80] = 64
 dependencies   [0xf2a40b80,0xf2a40b84] = 4
Compiled method (c1)   14533  125             java.util.HashMap::put (13 bytes)
 total in heap  [0xf2a408c8,0xf2a40b84] = 700
 relocation     [0xf2a40994,0xf2a409bc] = 40
 main code      [0xf2a409c0,0xf2a40aa0] = 224
 stub code      [0xf2a40aa0,0xf2a40b04] = 100
 metadata       [0xf2a40b04,0xf2a40b14] = 16
 scopes data    [0xf2a40b14,0xf2a40b40] = 44
 scopes pcs     [0xf2a40b40,0xf2a40b80] = 64
 dependencies   [0xf2a40b80,0xf2a40b84] = 4
#
# If you would like to submit a bug report, please visit:
#   http://www.azulsystems.com/support/
#
qemu: uncaught target signal 6 (Aborted) - core dumped

Faulty endpoints

Hey guys I just had a go at integrating the ui with the API. I found a few endpoints that didn't resolve. I'm opening one issue as they may have changed from the spec or they may just not be working on the demo, unfortunately, they are important endpoints and I can't move forward without them.

All /api/protocols/discovery/* don't appear to work. eg
GET http://217.77.95.110:8080/api/protocols/discovery 500 (Internal Server Error)
// returns internal server error

Cannot register a device
POST http://217.77.95.110:8080/api/devices 500 (Internal Server Error)

Cannot get a device resource
GET http://217.77.95.110:8080/api/devices/ble68C90B179306 500 (Internal Server Error)
{
"code": "INTERNAL_SERVER_ERROR",
"message": "Not implemented"
}

/DeviceManager/Devices
NIT: There is no name attribute returned in the resource. But the spec it is present.
http://petstore.swagger.io/?url=http://agile-iot.github.io/agile-api-spec/docs/swagger/api.swagger.yml#!/DeviceManager/Devices

As I said feel free to split this into separate issues if need.

Issues with Registering Devices

If I query all devices via /api/protocols/devices

it returns an object like this:

{
    "id": "B0:B4:48:BD:10:85",
    "protocol": "iot.agile.protocol.BLE",
    "name": "CC2650 SensorTag",
    "status": "AVAILABLE"
  }

However it appears to register a device a stream object needs to present. Eg. this doesn't work:

{
"deviceId": "",
"address": "B0:B4:48:BE:7D:83",
"name": "CC2650 SensorTag",
"description": "",
"protocol": "iot.agile.protocol.BLE",
"path": ""
}

In my opinion, you should be able to post back an unregistered device object recieved from /api/protocols/devices but the current registration endpoint requires other attributes like address and a blank deviceId instead of id.

Thoughts?

get /devices error

After a reboot I got many times errors on the get /devices. A reboot sometimes solves it.

14:11:06.538 [qtp13821883-28] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.DeviceManager:/iot/agile/DeviceManager
14:11:06.545 [qtp13821883-28] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.DeviceManager.Devices: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.freedesktop.dbus.Error.getException(Unknown Source)
    at org.freedesktop.dbus.Error.throwException(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy56.Devices(Unknown Source)
    at iot.agile.http.resource.DeviceManager.Devices(DeviceManager.java:105)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)



Error on POST `/device/{deviceId}/{sensorName}`

Hi,
I'm trying to write data on one device through the http api but seems that the payload data parameter is missing and the subsequent Write does nothing.

@POST
@Path("/{sensorName}")
public void Write(@PathParam("id") String id, @PathParam("sensorName") String sensorName) throws DBusException {
    try {
      getDevice(id).Write();
    } catch (UnknownObject ex) {
      throw new AgileDeviceNotFoundException("Device not found");
    } catch (Exception ex) {
      throw new WebApplicationException("Error on writing data", ex);
    }
  }

Regards

error posting a new device to the api

I'm working with the agile-BLE dockers and i got an issue with the post of a new device to the api. I got the following error:

"Can not deserialize instance of iot.agile.object.DeviceDefinition out of START_ARRAY tokenat [Source:org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@18ea575; line: 1, column: 1]"[2:53]

At who can I direct my questions concerning the agile BLE. I'm working on a WP for agile and wonder if their is a technical slack or other messenger option available.

/api/devices/typof error

call:
GET http://217.77.95.110:8080/api/devices/typof

response:
Malformed JSON: Syntax error

connected to #27 and therefore blocking device registration

error in logs while discovering devices

Happens most of the times when I do a cold start of the pi -> run the agile-core docker -> discover devices

If I see the error appear in the logs I can no longer post new devices

I build the latest master commit

The logs from the agile-core docker (filtered irrelevant local mac address)

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Agile BLE Protocol 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ ble ---
Java HotSpot(TM) Client VM warning: You have loaded library /usr/src/app/deps/libunix-java.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
12:02:45.929 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:02:45.929 [Thread-4] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
Java HotSpot(TM) Client VM warning: You have loaded library /usr/src/app/deps/libunix-java.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
12:03:23.657 [Thread-4] INFO  i.a.p.ProtocolManagerImp - Initializing discovery
12:03:23.660 [Thread-4] INFO  i.a.p.ProtocolManagerImp - Discovery for protocol iot.agile.object.ProtocolOverview<BLE, Bluetooth LE, iot.agile.protocol.BLE, Avaliable> : /iot/agile/protocol/BLE
12:03:23.723 [Thread-5] INFO  i.agile.protocol.ble.BLEProtocolImp - Started discovery of BLE devices
12:03:24.475 [qtp5869079-33] INFO  i.a.http.ws.AgileWebSocketAdapter - New websocket connection from /192.168.1.128:24611 for /ws/
12:03:25.397 [Thread-4] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.392 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 
12:03:25.404 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.406 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.408 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 
12:03:25.408 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.409 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.411 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.411 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 
12:03:25.413 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.414 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.414 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.417 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name =
12:03:25.418 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.418 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.420 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.421 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 
12:03:25.423 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.424 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.424 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.426 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name =
12:03:25.427 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.428 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.430 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.430 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 
12:03:25.432 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address = 
12:03:25.433 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:25.433 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:25.435 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Found 7 new device(s)
12:03:31.445 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Name = 
12:03:31.446 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Address =
12:03:31.448 [Thread-2] INFO  i.a.p.ProtocolManagerImp - Found new device signal received
12:03:31.447 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Connected= false
12:03:31.448 [pool-1-thread-1] INFO  i.agile.protocol.ble.BLEProtocolImp - Found 1 new device(s)
12:03:45.400 [qtp5869079-30] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.ProtocolManager:/iot/agile/ProtocolManager
12:03:45.400 [qtp5869079-30] DEBUG iot.agile.http.service.DbusClient - Load cached object iot.agile.ProtocolManager:/iot/agile/ProtocolManager
12:03:46.362 [qtp5869079-37] DEBUG i.agile.http.resource.DeviceManager - Register new device of type TI SensorTag: B0:B4:48:C0:8F:03 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:03:46.362 [qtp5869079-36] DEBUG i.agile.http.resource.DeviceManager - Register new device of type TI SensorTag: B0:B4:48:BE:7D:83 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:03:46.362 [qtp5869079-36] DEBUG i.agile.http.resource.DeviceManager - Register new device of type TI SensorTag: B0:B4:48:BE:7D:83 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:03:46.362 [qtp5869079-37] DEBUG i.agile.http.resource.DeviceManager - Register new device of type TI SensorTag: B0:B4:48:C0:8F:03 (CC2650 SensorTag) on iot.agile.protocol.BLE
12:03:46.418 [qtp5869079-37] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
org.freedesktop.dbus.exceptions.DBusExecutionException: Failed to construct outgoing method call: Trying to marshall to unconvertable type (from java.lang.String to 40).
    at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)
    at org.freedesktop.dbus.RemoteInvocationHandler.invoke(Unknown Source)
    at com.sun.proxy.$Proxy56.Register(Unknown Source)
    at iot.agile.http.resource.DeviceManager.Register(DeviceManager.java:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
    at org.eclipse.jetty.server.Server.handle(Server.java:524)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
    at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)

start discovery failures

I'm occasionally getting a failure on POST /protocols/discovery. Seems to be a race condition.

agile-ble_1   | 08:51:49.841 [Thread-2] INFO  i.agile.protocol.ble.BLEProtocolImp - Started discovery of BLE devices
agile-core_1  | 08:51:49.856 [qtp22223153-9] ERROR i.a.h.exception.AgileExceptionMapper - Error occured
agile-core_1  | org.freedesktop.dbus.exceptions.DBusExecutionException: Error Executing Method iot.agile.Protocol.StartDiscovery: null
agile-core_1  | 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
agile-core_1  | 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
agile-core_1  | 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
agile-core_1  | 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
agile-core_1  | 	at org.freedesktop.dbus.Error.getException(Unknown Source)
agile-core_1  | 	at org.freedesktop.dbus.Error.throwException(Unknown Source)
agile-core_1  | 	at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(Unknown Source)

similar end points?

What is the difference between:
GET /device/{deviceId}/{componentId}
GET /device/{deviceId}/{componentId}/lastUpdate

and also between:
GET /device/{deviceId}
GET /device/{deviceId}/lastUpdate

Each pair returns the same thing? Retire last update?

Offline devices still visible in /protocols/devices

A script on my pi uses the call /protocols/devices to sniff for devices in range.
then it tries to connect with those devices if they are sensorTags.

Since the last update old devices stay in the list even after a reboot of the pi and a docker rm of the container.

I dont know where the cache is coming from but now I don't know which devices are in range and I can connect with. This is a problem for my use case where The sensorTags can be dynamically added to the setup.

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.