Coder Social home page Coder Social logo

sitewhere / sitewhere Goto Github PK

View Code? Open in Web Editor NEW
996.0 96.0 382.0 54.65 MB

SiteWhere is an industrial strength open-source application enablement platform for the Internet of Things (IoT). It provides a multi-tenant microservice-based infrastructure that includes device/asset management, data ingestion, big-data storage, and integration through a modern, scalable architecture. SiteWhere provides REST APIs for all system functionality. SiteWhere provides SDKs for many common device platforms including Android, iOS, Arduino, and any Java-capable platform such as Raspberry Pi rapidly accelerating the speed of innovation.

Home Page: https://sitewhere.io

License: Other

Java 99.84% Groovy 0.10% Shell 0.06%
sitewhere internet-of-things integration device-management iot iot-platform platform mqtt iot-framework java

sitewhere's Introduction

Build Status Docker Pulls

SiteWhere


SiteWhere is an industrial strength, open source IoT Application Enablement Platform which facilitates the ingestion, storage, processing, and integration of IoT device data at massive scale. The platform leverages a microservices architecture which runs on top of cutting-edge technologies such as Kubernetes, Istio, and Kafka in order to scale efficiently to the loads expected in large IoT projects.

SiteWhere embraces a distributed architecture which runs on Kubernetes and provides both infrastructure such as highly-available databases and MQTT brokers as well as microservices to facilitate various aspects of IoT project development. The platform is built with a framework approach using clearly defined APIs so that new technologies may easily be integrated as the IoT ecosystem evolves.

SiteWhere Administration

Deployment and Orchestration

SiteWhere is composed of Java-based microservices which are built as Docker images and deployed to Kubernetes for orchestration. To simplify installation and configuration, Helm is used to provide standard templates for various deployment scenarios. Helm charts are provided to supply both the microservices and the dependencies needed to run a complete SiteWhere deployment. Infrastructure components include technologies such as Apache Zookeeper and Kafka, highly available databases such as MongoDB, InfluxDB, and Cassandra, and other supporting technologies such as MQTT brokers.

Microservices

Rather than using a monolithic approach, SiteWhere is based on many microservices running as a distributed system. Each microservice is a completely self-contained entity that has its own configuration schema, internal components, data persistence, and interactions with the event processing pipeline. SiteWhere microservices are built on top of a custom microservice framework and run as separate Spring Boot processes, each contained in its own Docker image.

SiteWhere Architecture

Separation of Concerns

Separating the system logic into microservices allows the interactions between various areas of the system to be more clearly defined. It also allows parts of the pipeline to be shutdown or fail gracefully without preventing other parts of the system from functioning. The event processing pipeline, which spans many of the microservices, is buffered by Kafka so that data processing has strong delivery guarantees while maintaining high throughput.

Scale What You Need. Leave Out What You Don't

The microservice architecture allows individual functional areas of the system to be scaled independently or left out completely. In use cases where REST processing tends to be a bottleneck, multiple REST microservices can be run concurrently to handle the load. Conversely, services such as presence management that may not be required can be left out so that processing power can be dedicated to other aspects of the system.

Instance Management

SiteWhere supports the concept of an instance, which allows the distributed system to act as a cohesive unit with some aspects addressed at the global level. All of the microservices for a single SiteWhere instance must be running on the same Kubernetes infrastucture, though the system may be spread across tens or hundreds of machines to distribute the processing load.

Service Mesh with Istio

SiteWhere leverages Istio to provide a service mesh for the system microservices, allowing the platform to be scaled dynamically while also providing a great deal of control over how data is routed. Istio allows modern methods such as canary testing and fault injection to be used to provide a more robust and fault-tolerant system. It also allows for detailed monitoring and tracing of the data flowing through the components.

Centralized Configuration Management with Apache ZooKeeper

SiteWhere configuration is stored in Apache ZooKeeper to allow for a scalable, externalized approach to configuration management. ZooKeeper contains a hierarchical structure which represents the configuration for one or more SiteWhere instances and all of the microservices that are used to realize them. The configuration is replicated for high availabilty.

Each microservice has a direct connection to ZooKeeper and uses the hierarchy to determine its configuration at runtime. Microservices listen for changes to the configuration data and react dynamically to updates. No configuration is stored locally within the microservice, which prevents problems with keeping services in sync as system configuration is updated.

Distributed Storage with Rook.io

Since many of the system components such as Zookeeper, Kafka, and various databases require access to persistent storage, SiteWhere uses Rook.io within Kubernetes to supply distributed, replicated block storage that is resilient to hardware failures while still offering good performance characteristics. As storage and throughput needs increase over time, new storage devices can be made available dynamically. The underlying Ceph architecture used by Rook.io can handle exobytes of data while allowing data to be resilient to failures at the node, rack, or even datacenter level.

High Performance Data Processing Pipeline

The event processing pipeline in SiteWhere uses Apache Kafka to provide a resilient, high-performance mechanism for progressively processing device event data. Microservices can plug in to key points in the event processing pipeline, reading data from well-known inbound topics, processing data, then sending data to well-known outbound topics. External entites that are interested in data at any point in the pipeline can act as consumers of the SiteWhere topics to use the data as it moves through the system.

Fully Asynchronous Pipeline Processing

The SiteWhere event processing pipeline leverages Kafka's messaging constructs to allow device event data to be processed asynchronously. If a microservice shuts down and no other replicas are available to process the load. The data will be queued until a replica starts and begins processing again. This acts as a guarantee against data loss as data is always backed by Kafka's high-performance storage. SiteWhere microservices leverage Kafka's consumer groups concept to distribute load across multiple consumers and scale processing accordingly.

Using Kafka also has other advantages that are leveraged by SiteWhere. Since all data in the distributed log is stored on disk, it is possible to "replay" the event stream based on previously gathered data. This is extremely valuable for aspects such as debugging processing logic or load testing the system.

API Connectivity Between Microservices

While device event data generally flows in a pipeline from microservice to microservice on Kafka topics, there are also API operations that need to occur in real time between the microservices. For instance, device management and event management functions are contained in their own microservices, but are required by many other components of the system. Many of the SiteWhere microservices offer APIs which may be accessed by other microservices to support aspects such as storing persistent data or initiating microservice-specific services.

Using gRPC for a Performance Boost

Rather than solely using REST services based on HTTP 1.x, which tend to have significant connection overhead, SiteWhere uses gRPC to establish a long-lived connection between microservices that need to communicate with each other. Since gRPC uses persistent HTTP2 connections, the overhead for interactions is greatly reduced, allowing for decoupling without a significant performance penalty. Istio also allows the gRPC connections to be multiplexed across multiple replicas of a microservice to scale processing and offer redundancy.

The entire SiteWhere data model has been captured in Google Protocol Buffers format so that it can be used within GRPC services. All of the SiteWhere APIs are exposed directly as gRPC services as well, allowing for high-performance, low-latency access to all API functions. The REST APIs are still made available via the Web/REST microservice (acting as an API gateway), but they use the gRPC APIs underneath to provide a consistent approach to accessing data.

Multitenancy

SiteWhere is designed for large-scale IoT projects which may involve many system tenants sharing a single SiteWhere instance. A key differentiator for SiteWhere compared to most IoT platforms is that each tenant runs in isolation from other tenants. By default, tenants do not share database resources or pipeline processing and have a completely separate configuration lifecycles. With this approach, each tenant may use its own database technologies, external integrations, and other configuration options. Parts of the tenant's processing pipeline may be reconfigured/restarted without causing an interruption to other tenants.

Data Privacy

An important consequence of the way SiteWhere handles multitenancy is that each tenant's data is separated from the data of other tenants. Most platforms that offer multitenancy store data for all tenants in shared tables, differentiated only by a tenant id. The shared approach opens up the possibility of one tenant's data corrupting another, which is not an acceptable risk in many IoT deployments. In addition, each tenant has its own processing pipelines, so in-flight data is never co-mingled either.

Having dedicated resources for tenants can be expensive in terms of memory and processing resources, so SiteWhere also offers the concept of customers within each tenant. Customers allow data to be differentiated within a tenant, but without having a separate dedicated database and pipelines. In cases where colocated data is acceptable, the tenant can have any number of customers, which shared the same database and processing pipeline. This allows the best of both worlds in terms of security and scalability.


Copyright (c) 2009-2019 SiteWhere LLC. All rights reserved.

sitewhere's People

Contributors

atm006 avatar bickster avatar cwalker67 avatar derekadams avatar edward-doong avatar garysmi2 avatar garysmith2 avatar jorgevillaverde-sitewhere avatar k33g avatar light940929 avatar limpo2000 avatar lmd avatar scnets avatar unofapre16 avatar x-falcon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sitewhere's Issues

Sitewhere: Problem with Emulate Assignment (MAP)?

Hi @derekadams,
As I know, Sitewhere is using OpenStreetMap, it's free, but today I dont know why when I access to device assignment to see the Map but it's appear the result as picture bellow.
7-20-2016 9-47-07 am
I dont have any experience about the Map, could you please take a look and give me any recommand?
Thanks you so much

tenant default config of event sources

Event sources include the mqtt topic,default topic is same for every new tenant, such as "SiteWhere/input/protobuf".
If tenant user don't change this topic, then each tenant subscribe the some topic, so the message will be process by many tenant.

Is it necessary to add special rules for the default topic to distinguish the different tenant ?

Sitewhere Exception on server startup using STS. I could run the sitewhere with start.sh after gradle build. Please help me, I am a student about gradle, please make it clear on how to update the build.gradle step by step, thanks a lot.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/foton/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-all/5.10.0/bb376083b608a6f74e3d3c06afb92049549302c9/activemq-all-5.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/foton/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.13/55517a839e93c29d8a6ce8d8504a3e124e3a5a2f/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/foton/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.3/d90276fff414f06cb375f2057f6778cd63c6082f/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/home/foton/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-all/5.10.0/bb376083b608a6f74e3d3c06afb92049549302c9/activemq-all-5.10.0.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext
at org.springframework.util.Assert.isInstanceOf(Assert.java:346)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:223)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLogger(LogbackLoggingSystem.java:215)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartedEvent(LoggingApplicationListener.java:191)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:173)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:60)
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.sitewhere.web.SiteWhereWebApplication.main(SiteWhereWebApplication.java:133)

some problems about status of tenant engine

The status of tenant engine isn't persisted in the database,so the status will lose if the sitewhere server restart.For example:
Tenant named A be stopped by user, if the admin restart server, tenant A will start.
Also the config file is seperated for each tenant,so it is hard to deploy mulit-instance.

I want to if there are any dev plan to make the system for high availability and horizontal scalability.

Problem during start tenant!

Hi All,
I created new tenant and then start it but It appear an error.
`14:43:58,258 INFO [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v2.2.2) '123456' with instanceId 'sitewhere'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 5 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

14:43:58,258 INFO [DirectSchedulerFactory] Quartz scheduler '123456
14:43:58,258 INFO [DirectSchedulerFactory] Quartz scheduler version: 2.2.2
14:43:58,258 INFO [QuartzScheduleManager] QuartzScheduleManager state transitioned to STARTING.
14:43:58,258 INFO [QuartzScheduler] Scheduler 123456_$_sitewhere started.
14:43:58,258 INFO [QuartzScheduleManager] Updated cache with 5 schedules.
14:43:58,259 INFO [QuartzScheduleManager] QuartzScheduleManager state transitioned to STARTED.
14:43:58,259 INFO [SiteWhereTenantEngine] Tenant Engine: freeman state transitioned to STARTED.
14:43:58,260 INFO [ResponseTimerFilter] Call for POST to 'http://sitewhereweb:8080/sitewhere/api/tenants/123456/engine/start' returned in 105 ms.
14:43:58,717 INFO [ResponseTimerFilter] Call for GET to 'http://sitewhereweb:8080/sitewhere/api/users' returned in 2 ms.
14:43:58,725 INFO [ResponseTimerFilter] Call for GET to 'http://sitewhereweb:8080/sitewhere/api/tenants/123456' returned in 5 ms.
14:43:58,732 INFO [ResponseTimerFilter] Call for GET to 'http://sitewhereweb:8080/sitewhere/api/tenants/123456/engine/configuration/json' returned in 12 ms.`

Thanks

How to update remotely sitewhere java agent from SiteWhere?

Dear @derekadams ,
Did SiteWhere have the feature for remote update sitewhere-java-agent on the device from the sitewhere? For example, I have 100 raspberry pi devices, if I update something on sitewhere-java-agent from device 1 I have to copy jar file to the rest of devices one by one by the way ssh directly to each device, so It's can be have an upload page that allow upload new firmware (update agent) for the devices? I think this is great feature, so If it doesn't have yet, please concern to develop this feature in the future!
Thanks

Sitewhere server 1.7.0 missing some directory in tomcat?

Hi @derekadams ,
I am trying to build sitewhere 1.7.0 from the source code, when finishing, I go to inside "distributions" folder to copy the file "sitewhere-server-1.7.0.taz" to server, but when I extract this file, inside "sitewhere-server-1.7.0" only have 3 folders "bin", "conf" and "lib", it's doesn't enough for tomcat like the previous version 1.6.1. I did not see temp, logs, webapp folder...So there are missing something here?
Please check it!
Thanks you

Response to Locations

Hi,
How is it possible to send response data to Devices after Receiving Locations on the server ?
I mean I want to send some information based on Devices Locations

Sitewhere installation problem

I have set up mongodb server and is up n running and installed the mosquitto MQTT broker. But unable to access the administartive console of the sitewhere

processing data in sitewhere and send to device

hi guys
i have a Scenario for running a project
i have a Traffic application which that install on a lot of android device, and they send measurements and location to sitewhere(till here no problem).
now i want to process them(received data from devices) and send All data received last ten minutes to all device. how i can do it?? which external system , i should ingratiate by sitewhere??
how i can send All data received last ten minutes .

Multi-tenant Unable to create/use specifications in newly created tenant so can't create device

Hi Derek, myself again.

I'll try and make my bug reports a bit more formal and helpful too yourself.

Using SiteWhere 1.6.0 with the provided sitewhere.war

Pre-Steps:

  • deleted sitewhere and sitewhere tenant databases from mongod
  • deleted the contents of the sitewhere folder containing the default and other created tenants

Issue

  1. Log in as admin and create and activate a new tenant.
  2. Logout
  3. Log back in again and select the newly created tenant
  4. Try and create a device - in the specification tab the specification list is empty.
  5. Try and create a new specification using either the default "Asset Provider - Default Device Management" or one created by yourself.
  6. Fill in the fields and click the create button.

Expected:
A new specification is created and appears in the list.

Actual:
List remains empty and there is no visual feedback.

Two browser requests are generated as the result of clicking on create button. The last one fails:

http://localhost:8080/sitewhere/api/specifications?includeAsset=true&tenantAuthToken=nimbustest&take=15&skip=0&page=1&pageSize=15

Params:

  • includeAsset true
  • page 1
  • pageSize 15
  • skip 0
  • take 15
  • tenantAuthToken nimbustest

Response:

400 Bad Request (removed most of the irrelevant html)

<u>InvalidAssetReferenceId:Asset reference not found.</u></p><p><b>description</b> <u>The
 request sent by the client was syntactically incorrect.</u>

I've attached partial log too:

[catalina.txt](https://github.com/sitewhere/sitewhere/files/129740/catali

Problem with deploying sitewhere mongodb

Hi Sitewhere team,

I'm pretty new to Sitewhere, and I tried to install the sitewhere mongodb on my Ubuntu 14.04 machine through Juju. However, I get an error: 'hook failed: "config-changed"'

What is the problem?

I just use the juju tutorial offered on Sitewhere. Here is my log:

2016-02-03 05:25:17 INFO config-changed File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/hooks.py", line 1668, in
2016-02-03 05:25:17 INFO config-changed hooks.execute(sys.argv)
2016-02-03 05:25:17 INFO config-changed File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/charmhelpers/core/hookenv.py", line 546, in execute
2016-02-03 05:25:17 INFO config-changed self._hookshook_name
2016-02-03 05:25:17 INFO config-changed File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/hooks.py", line 981, in config_changed
2016-02-03 05:25:17 INFO config-changed re.MULTILINE).group(1)
2016-02-03 05:25:17 INFO config-changed AttributeError: 'NoneType' object has no attribute 'group'
2016-02-03 05:25:17 ERROR juju.worker.uniter.operation runhook.go:107 hook "config-changed" failed: exit status 1

Any guess is welcome :)

Regards,
Duy

Map Not Displaying

Hi,
Please Check Map is not displaying ... in edit site... and how to add custom map type ? like Google Map or Openstreet Map API..?

sitwhr

getting sitewhere-tenant.properties (No such file or directory) in log

HI,

I just installed sitewhere 1.8.0 and started the server , i found in log following.

INFO [PropertySourcesPlaceholderConfigurer] Loading properties file from URL [file:/opt/sitewhere/conf/tenants/default/sitewhere-tenant.properties]
WARN [PropertySourcesPlaceholderConfigurer] Could not load properties from URL [file:/opt/sitewhere/conf/tenants/default/sitewhere-tenant.properties]: /opt/sitewhere/conf/tenants/default/sitewhere-tenant.properties (No such file or directory)

why it is throwing above?

sitewhere device communication

@derekadams I have an instance of sitewhere running with Mosquitto Mqtt broker. I have an application which reads the hardware Id, specification etc., My question is how do i connect this application to connect to sitewhere to register a device.

Sitewhere Exception during try to Create Twilio Command Destination: The content of element 'sw:twilio-command-destination' is not complete

Hi @derekadams ,

I am trying to Create Twilio Command Destination. After I fill the exactly my information at "Destination id", "Account SID", "Authorization token", and "From phone number" then I click on "Stage Updates" then I receive below message

"Tenant has staged updates that have not been applied. Restart tenant to apply changes."

therefore I restart tenant but the exception appear on the log below.

Caused by: org.xml.sax.SAXParseException; lineNumber: 56; columnNumber: 187; cvc-complex-type.2.4.b: The content of element 'sw:twilio-command-destination' is not complete. One of '{"http://www.sitewhere.com/schema/sitewhere/ce/tenant":abstract-command-encoder}' is expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:452)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3230)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3206)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3153)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3055)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2134)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:769)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:357)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391)
... 11 more
And in the tenant page will see that tenant status is error.
screen shot 2016-08-17 at 11 35 03 pm

Please take a look.
Thanks you

send commands to multiple devices

hi, I have tried the nested device and device group then I found these functions are not for the broadcast command to multiple devices.
If I want to send a message ( command ) to a group of devices, do we have any function could do this in current Sitewhere? Thanks.

List devices error during browser sitewhere!

Hi @derekadams
I am running sitewhere 1.6 on Ubuntu. I am trying to browser the list of devices on Web Admin GUI.
http://mysitewhereipaddress:8080/sitewhere/admin/devices/list.html
But nothing is show, I've checked on the catalina.out file it's throw an exception below.
21:38:26,712 ERROR [RestController] Exeception thrown during REST processing. com.sitewhere.spi.SiteWhereException: Device references non-existent specification. at com.sitewhere.device.marshaling.DeviceMarshalHelper.convert(DeviceMarshalHelper.java:101) at com.sitewhere.web.rest.controllers.DevicesController.listDevices(DevicesController.java:433) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
I dont know what happen because the last time it's ok. I also check on mongodb, the data is existence with command.

db.devices.find(); // it's show data
But it's not show in the web and the exception is throw as above. Please tell me to check it out.
Thanks you so much

Problem during deploy sitewhere 1.8 on Ubuntu 14.04!

Hi,
I am build sitewhere 1.8 from the source code, after make tgz file, I extract and run startup.sh like this

tar -zxvf sitewhere-server-1.8.0.tgz
mv sitewhere-server-1.8.0 /opt/sitewhere
export SITEWHERE_HOME=/opt/sitewhere
cd /opt/sitewhere/bin
sh startup.sh
But it could not run and appear below message on the terminal

> freeman@ubuntu01:/opt/sitewhere/bin$ sh startup.sh
> 
>   SiteWhere Start Script for Linux/Unix v1.0
> 
> : not found 5: startup.sh: 
> startup.sh: 52: startup.sh: Syntax error: end of file unexpected (expecting "then")
> freeman@ubuntu01:/opt/sitewhere/bin$ 

while I change to sitewhere 1.7.0 it's still ok.

Please take a look

How to understand asset management?

Hi @derekadams,

I have installed sitewhere and downloaded the source code. While I have questions about asset management module.

  1. Are the items in Default Device Management (fs-devices) asset category? If not, why is a device specification associated with one item in fs-devices?

2.Are the items in fs-hardware or fs-persons asset instance instead of asset category?

I am puzzled how to understand it. Hope you gives answers.

Logging in when multiple tenants have been created

Hi Derek,

trying out the official download of 1.6.0

Issue:

Create an additional tenant as well as the default one.
Logout and log back in again.
On the tenant selection screen select one.

Results in an error and the message:
"Invalid tenant choice"

I built from source and checked - on the initial selection the correct id for the selected tenant is passed back to the controller.
However, from logging the output of the loop where chosen is selected it looks like the endpoint is being called multiple times and on every subsequent invocation the tenantId is being passed in as the string "server" and the error message above is the ultimate result.

upload multiple event by MQTT's jsonbatch topic

hi Adam,
I upload the measurements, alerts and locations via MQTT's jsonbatch topic, and it works fine,

{  
   "hardwareId":"hwid",
   "measurements":[  
      {  
         "eventDate":"2015-06-05T09:07:25.725Z",
         "measurements":{  
            "measureTitle1":123,
            "measureTitle2":0
         },
         "metadata":{  
            "metaTitle1":"test metadata"
         }
      }
   ]
}

but I need to send every single event separately,

Could I send many measurements just by one MQTT package?
Just like the POST method /devices/{hardwareId}/batch
I have tested this format below, but it's failed.

{  
   "hardwareId":"hwid",
   "measurements":[  
      {  
         "eventDate":"2015-06-05T09:07:25.725Z",
         "measurements":{  
            "measureTitle1":123,
            "measureTitle2":0
         },
         "metadata":{  
            "metaTitle1":"test metadata"
         }
      },
      {  
         "eventDate":"2015-06-05T09:07:25.725Z",
         "measurements":{  
            "measureTitle1":"webbbbbbbbbbb",
            "measureTitle2":"bbaaaaaaaaaa"
         },
         "metadata":{  
            "metaTitle1":"mmmmmetaaaaaa"
         }
      }
   ]
}

Thanks~
Webb

Sitewhere could not connect to agents?

Hi @derekadams ,

Recently days, I could not connect sitewhere agent to sitewhere server, I've checked on MQTT Brocker and see that message "Maximum connections (25) for your license already reached. Closing client connection. Please contact [email protected] for a license upgrade or visit hivemq.com"
I think hiveMQ is not free so that i have to buy more connection. Therefore I tried to stop hiveMQ and install mosquitto, but I still couldn't connect to sitewhere server. :(
As I remember before version 1.6 sitewhere used mosquitto message broker, it's free, but now is hiveMQ, so is sitewhere 1.7 still working with mosquotto as well? Because now I could not connect to both hivemq and mosquitto.

Please take a look,

Thanks you so much

Including Wrong Javascript File

In sitewhere.web:

sitewhere-web/src/main/webapp/WEB-INF/jsp/login.jsp

Including kendo.web.js is resulting in a 404 error as it is the minified version that is in the scripts folder.

<script src="${pageContext.request.contextPath}/scripts/kendo.web.js"></script>

Should probably be

<script src="${pageContext.request.contextPath}/scripts/kendo.web.min.js"><script>

Problem during deploy sitewhere 1.6.0 to server!

Hi @derekadams,
I am deploying sitewhere to server ubuntu 14.04, after finish building with gradle in my eclipse local, I go to build/distributions folder to get file "sitewhere-server-1.6.0.tgz" and I upload it to my ubuntu server. After go inside the folder bin, I run the sh file. "./startup.sh" to start tomcat, It's seem that tomcat running normal but when I go to the site: "http://mysitewhereaddress:8080/sitewhere" nothing to show, it's a blank page. I also check the log in the file catalina.out but nothing. But with sitewhere 1.5.0, it's ok.

Please check it for me! Thanks

Error Loading Page

hi
I was faced with a problem, i deleted default tenant in sitewhere 1.5 for test, but now sitewhere was error

below error in administrator page

Error Loading Page
User is not authorized to access any of the available tenants.

error for listDeviceCommand

hi
i want get command from sitewhere then execute this command by bellow code, but this code has error


siteWhereClient = new SiteWhereClient("http://localhost:8081/sitewhere/api/","admin","password","sitewhere1234567890");
com.sitewhere.rest.model.system.Version version=siteWhereClient.getSiteWhereVersion();
DeviceCommandSearchResults command =siteWhereClient.listDeviceCommands("d2604433-e4eb-419b-97c7-88efe9b2cd41", true);



log output

Exception in thread "main" com.sitewhere.spi.SiteWhereSystemException: Unknown error.
    at com.sitewhere.rest.client.SiteWhereErrorHandler.handleError(SiteWhereErrorHandler.java:53)
    at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:484)
    at com.sitewhere.rest.client.SiteWhereClient.sendRest(SiteWhereClient.java:970)
    at com.sitewhere.rest.client.SiteWhereClient.listDeviceCommands(SiteWhereClient.java:306)
    at com.tavana.sitewhere.SiteWhereCommand.main(SiteWhereCommand.java:99)

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project MySiteWhere: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

How to integrate GPS tracker to SiteWhere?

Hi @derekadams,

As I see in Web Admin, SiteWhere support to connect to GPS tracker something like MeiTrack GPS device!!!
Could you please tell me how to connect it to SiteWhere? So that I can get lat, long from it!
Because As I see it's doesn't have the OS. So I could not use the provided Agent! Please give me an advice!
Thanks you so much

issue about edit metadata ( V1.0.0)

hi, I meet some problem when I try to edit the metadata.
When I create a device with metadata, then edit it. I found that I cannot remove all the metadata.

for example.
create device A with metadata like : { "key1" : "value1" }
then I try to remove all the metadata, so I send a empty json object as the metadata obj in the Restful API like : {}
then the data in the database won't be changed. => still { "key1" : "value1" }

but if I send another set of key value pair like { "key2" : "value2" }
then I will get the correct result => { "key2" : "value2" }
It's seems the metadata json object must keep at least one pair inside.

this issue was not just occur in the edit device pages, including the edit user , device group and specification pages all have the same problem. Especially the device group, it cannot remove any metadata.

Could you help to check this issue ? thanks.
( but this issue was not occur on edit site page )

By the way, does the feature of creating a device with a specific site token was done?
sitewhere/sitewhere-android#3

Thanks again~~

How to connect Sitewhere to the device support MQTT but doesn't have the OS?

Hi @derekadams ,
I have devices that support MQTT protocol but they don't have operating system. It's mean that the devices can send information to service broker server as mosquito or hivemq via port 1883. But how sitewhere can manage those devices without firmware because they don't have the OS? I want to connect them to sitewhere. Could you please tell me how?!
PS: The last issue #49 is idea to connect the MeiTrack to sitewhere via socket, because MeiTrack doesn't support MQTT protocol.
Thanks you so much

Error "error configuring application listener of class com.sitewhere.web.ShutdownListener" during deploy Sitewhere with Tomcat 8

Hi All

I am new to Sitewhere, I just downloaded sitewhere project and deploy to tomcat for debugging. But when I run it on tomcat, it's appear the error below. I am using the latest version of sitewhere 1.5 Please check it out for me. Below is error.

SEVERE: Error configuring application listener of class com.sitewhere.web.ShutdownListener
java.lang.ClassNotFoundException: com.sitewhere.web.ShutdownListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4734)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Thanks you so much

why this project build war but run use java -jar

I can't run this project in idea, but can run it through startup.bat script.
See this:
java %JAVA_OPTS% %JPDA_OPTS% -jar %SITEWHERE_FOLDER%/lib/sitewhere.war
this war can't run in tomcat because it include some tomcat and servlet api
why don't build project to a jar for running?

SiteWhere1.6.1 - Not authorized to view information for tenant!

Dear @derekadams ,
I meet this bug when I try to reproduce following below steps.
1- I login with admin account
2- I create new tenant with id = "123456" and new user with username is "freeman" and assign full permission for "freeman" account, also assign freeman account belong to this new tenant!
3- I logout admin account and try to access webservice page to check REST API (http://mysitewhereserver:8080/sitewhere/) with authenticate by "freeman" account not admin account but in the top of the rest api page it's still show login with user "admin", password ***** and tenant is "sitewhere1234567890".
4- I logout "freeman" account again and login with "admin" account and browser to list device, list spectification, sites.. all of it will throw the exception "com.sitewhere.spi.SiteWhereSystemException: Not authorized to view information for tenant." and in Admin GUI dont have any data.

16:02:06,008 ERROR [RestController] Exeception thrown during REST processing.
com.sitewhere.spi.SiteWhereSystemException: Not authorized to view information for tenant.
at com.sitewhere.web.rest.RestController.getTenant(RestController.java:60)
at com.sitewhere.web.rest.controllers.SitesController.listSites(SitesController.java:223)
at sun.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sitewhere.web.JsonpFilter.doFilter(JsonpFilter.java:80)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sitewhere.web.NoCacheFilter.doFilterInternal(NoCacheFilter.java:37)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sitewhere.web.ResponseTimerFilter.doFilterInternal(ResponseTimerFilter.java:40)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.sitewhere.web.MethodOverrideFilter.doFilterInternal(MethodOverrideFilter.java:44)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:213)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
16:02:06,008 INFO [ResponseTimerFilter] Call for GET to 'http://mysitewhereserver:8080/sitewhere/api/sites' returned in 1 ms.
Please check it out. Thanks

query by siddhi

how i can query from Measurement events by sidhhi ?

In the example below ูˆ what i are that "mxname" and "engine.temp" and "mxvalue"??

<sw:siddhi-query
selector="from e1 = MeasurementStream[mxname == 'engine.temp'], e2 = MeasurementStream[mxname == 'engine.temp' and e1.assignment == assignment and ((e2.mxvalue - e1.mxvalue) > 5)] select e1.assignment insert into EngineTempRose">
<sw:stream-debugger stream="EngineTempRose"/> /sw:siddhi-query

ERROR! SiteWhere WAR not found.

Hi
I am trying to run sitewhere on the window local, I run the file 'startup.bat" to start sitewhere-server but it's not worked, here is message appear on cmd.

SiteWhere Start Script for Windows v1.0
ERROR! SiteWhere WAR not found.
Press any key to continue . . .

5-11-2016 10-50-03 am

I've checked 'sitewhere.war' is already located in "\sitewhere-server-1.7.0\sitewhere-server-1.7.0\lib"

Please check it, thanks

Installation issue

I install the sitewhere -1.2.0 on Windows Server 2012R2, and modify the default-tenant.xml to connect to Azure EventHub. But, when I start the server, I always meet this error.
2015-11-12 14:29:38,097 ERROR [EventHubOutboundEventProcessor] EventHubOutboundEventProcessor state transitioned to ERROR.
com.sitewhere.spi.SiteWhereException: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory]
at com.sitewhere.azure.device.communication.EventHubOutboundEventProcessor.start(EventHubOutboundEventProcessor.java:103)
at com.sitewhere.server.lifecycle.LifecycleComponent.lifecycleStart(LifecycleComponent.java:86)
at com.sitewhere.server.lifecycle.LifecycleComponent.startNestedComponent(LifecycleComponent.java:244)
at com.sitewhere.server.lifecycle.LifecycleComponent.startNestedComponent(LifecycleComponent.java:231)
at com.sitewhere.device.event.processor.DefaultOutboundEventProcessorChain.start(DefaultOutboundEventProcessorChain.java:58)
at com.sitewhere.server.lifecycle.LifecycleComponent.lifecycleStart(LifecycleComponent.java:86)
at com.sitewhere.server.lifecycle.LifecycleComponent.startNestedComponent(LifecycleComponent.java:244)
at com.sitewhere.server.SiteWhereServer.start(SiteWhereServer.java:382)
at com.sitewhere.server.lifecycle.LifecycleComponent.lifecycleStart(LifecycleComponent.java:86)
at com.sitewhere.SiteWhere.start(SiteWhere.java:35)
at com.sitewhere.web.SiteWhereServerLoader.init(SiteWhereServerLoader.java:45)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5267)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5557)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at javax.naming.InitialContext.init(InitialContext.java:244)
at javax.naming.InitialContext.(InitialContext.java:216)
at com.sitewhere.azure.device.communication.EventHubOutboundEventProcessor.start(EventHubOutboundEventProcessor.java:93)
... 27 more
Caused by: java.lang.ClassNotFoundException: org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1722)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
... 31 more
which causes "2015-11-12 14:29:38,923 WARN [DefaultOutboundEventProcessorChain] Skipping event processor EventHubOutboundEventProcessor because its state is 'Error'".

Hope you can help :)

Sitewhere Exception on server startup!

Hi @derekadams,

I am trying to debug sitewhere 1.7 from the source code with intellij idea on the Window local. I already set JAVA_HOME and SITEWHERE_HOME on Environment Variables.. But when I run "SiteWhereWebApplication.java" it's throw an exception below.

10:35:16,437 ERROR [SiteWhereApplication] Exception on server startup. com.sitewhere.spi.SiteWhereException: SITEWHERE_HOME not set. at com.sitewhere.configuration.DefaultGlobalConfigurationResolver.getGlobalConfigurationFolder(DefaultGlobalConfigurationResolver.java:36) at com.sitewhere.configuration.FileSystemGlobalConfigurationResolver.getConfigurationRoot(FileSystemGlobalConfigurationResolver.java:155) at com.sitewhere.configuration.ConfigurationMigrationSupport.migrateProjectStructureIfNecessary(ConfigurationMigrationSupport.java:57) at com.sitewhere.server.SiteWhereServer.initialize(SiteWhereServer.java:752) at com.sitewhere.SiteWhere.start(SiteWhere.java:34)

Please take a look. Thanks you

Not authorized to view information for tenant during interact witth Sitewhere Server 1.6.1 using SiteWhere Java Client!

Hi,
I am using sitewhere java client to interact with sitewhere server, I write a function to get the list of devices spectification. With admin credentials it is ok, but with another account it throw the SiteWhereSystemException. Below is my code:

public static void main(String[] args) throws SiteWhereException {

  ISiteWhereClient client = new SiteWhereClient("http://mysitewhereserver:8080/sitewhere/api/", "freeman","abc@123456"); // admin account is ok
  //list devices
  SearchCriteria sc = new SearchCriteria(1,5);

  long numberOfResults = client.listDeviceSpecifications(true, true, sc).getNumResults();

  System.out.println("Number of results: " + numberOfResults);

  List<? extends DeviceSpecification> list = client.listDeviceSpecifications(true, true, sc).getResults();

  for (DeviceSpecification ds: list){
      System.out.println("Device Specification name: "+ ds.getName());
  }

}

If I run this code with admin account it's ok, but if i run with another account but full permission it's will throw with the exception:

Exception in thread "main" com.sitewhere.spi.SiteWhereSystemException: Not authorized to view information for tenant.
at com.sitewhere.rest.client.SiteWhereErrorHandler.handleError(SiteWhereErrorHandler.java:50)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:636)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:592)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:560)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:479)
at com.sitewhere.rest.client.SiteWhereClient.sendRest(SiteWhereClient.java:970)
at com.sitewhere.rest.client.SiteWhereClient.listDeviceSpecifications(SiteWhereClient.java:257)
at vn.vnpt.iot.m2m.web.service.impl.TestSiteWhere.main(TestSiteWhere.java:25)

But If i login directly in the GUI web with freeman/abc@123456 account it's still ok. Please check it
PS: Recognizing that all tenants is started!

Thanks

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.