Importing Sensor Data with the Java API

Topic: Importing Sensor Data with the Java API

Dear Sir,

I am working towards using the Wialon Java API to import my sensor data, which i will eventually use to develop an android mobile application.

As an initial step, I decided to run the example code listed at: http://sdk.wialon.com/wiki/en/sidebar/j … les/search

In spite of the fact that the code ran successfully, I did not get the desired output as exceptions occurred while running the code and I cannot quite figure out the problem. Please what could be missing out from the java code? The output of the code is shown below:

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/google/gson/JsonElement
    at UnitsSearchExample.run(UnitsSearchExample.java:110)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonElement
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 2 more
BUILD SUCCESSFUL (total time: 2 seconds)


In essence, like I mentioned earlier, my current project is to be able to import my sensor data in to my java code. Please can you give me some clue as to how to actualize this? I will greatly appreciate that.

Looking forward to your response.


Emmanuel Chidinma


Importing Sensor Data with the Java API

Re: Importing Sensor Data with the Java API

Hello, Emmanuel.

The stack trace shows that your program can't find a class definition for  com.google.gson.JsonElement.
Please include to your project Gson library and others, described at the requirements section in the GitHub project (https://github.com/wialon/java_wialon_sdk).

Mobile Development