Runtime error on Java(TM) SE Embedded Runtime Environment
Hi,
I wrote a simple test applicaiton with your jsondb. The application was running fine on windows/ubuntu and raspberry pi. But when i tried running it on a different embedded system (Arnv5tejl) I got an java.lang.NoClassDefFoundError: java/beans/PropertyDescriptor exception.
Before the exception I got a warning: "Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added". Any idea of what is going on here ?
java -version: Java(TM) SE Embedded Runtime Environment (build 1.8.0_65-b17, profile compact2, headless) Java HotSpot(TM) Embedded Minimal VM (build 25.65-b01, mixed mode)
uname -a: Linux gw-446D 4.4.24 #1 Thu Jan 26 09:10:47 CET 2017 armv5tejl GNU/Linux
Output:
# java -jar simplejsondb.jar
Hello World!
[main] INFO io.jsondb.JsonDBConfig - Encryption is not enabled for JSON DB
Jan 30, 2017 6:00:17 AM com.fasterxml.jackson.databind.ext.Java7Support
Just by looking at your Exception Stacktrace i think Java(TM) SE Embedded Runtime Environment does not have the "java.nio.file." package. I can fix this and create a version of JsonDB that does not uses classes from this package "java.nio.file." at all.
The other issue of "annotations" support not present in the Java(TM) SE Embedded Runtime Environment " is a bit of trouble, I will study this in a day or 2 when i get some time and try to see if i can find a decent workaround.
Thank you for you fast reply @FarooqKhan.
It would be really nice if we could make use of your package. It`s more straightforward and "cleaner" than the old "mapdb" option.
Hi PanzerHabba,
The initial warnings you see about "annotations, java.nio.file.Path" are a issue but it will not be a problem unless you try to Add a EventListener to the watch for direct changes to the db files using other filesystem utilities. This is a usecase that very few people would want to use.
However the issue of the class "ClassNotFoundException: java.beans.PropertyDescriptor" is a more troubles some. JsonDB uses Apache JxPath library very heavily for all the XPATH support. This JxPath library depends on the "java.beans" package. This is a problem that Android users face often becuase Dalvik does not have the "java.beans" package
I am surprised that Java SE Embedded does not have this package. If it is indeed true that Java SE Embedded does not have this package then you can try a workaround to your problem you will need to obtain the JxPath source code replace all usage of java.beans.* with "com.googlecode.openbeans" recompile and use this custom JxPath library
This is certainly a lot of work you probably wont want to do this.
I will keep looking for ways to solve this, and keep this open.
For now unfortunately i dont have a better solution.
Thanks Farooq
Hi FarooqKhan,
I didn't have any problem running a JsonDB simple code on this environment:
- Java(TM) SE Embedded Runtime Environment (build 1.8.0_131-b11, headless)
- Linux 4.9.39-2-ARCH #1 SMP Wed Jul 26 01:23:45 UTC 2017 armv7l GNU/Linux
I did a simple project saving data and making an XPath query.
Hope this info could help you.
Regards.
Thanks @ivanmarban this will help others who might be also trying on embedded platform