Problems generating a .jar from the repository

45 views
Skip to first unread message

Jürgen Baginski

unread,
Dec 20, 2020, 2:21:21 PM12/20/20
to rrd4j-discuss
Hello,

I'm using rrd4j (3.3.1) from within openHAB.
Actually I wrote an extension of the demo group (correct wording) for openHAB users in which data from a database other then rrd4j is fetched and stored in a .rrd file.
This is done! However only from within the IDE (Visual Stusio Code).
When trying to build a .jar containing the new function I'm failing with:
 "Fatal Error: Unable to find package java.lang in classpath or bootclasspath"

Would you know the cause of that problem?


BTW:
While testing a lot of my .rrd files I used your RRD-Inspector, however from a .jar file it worked only for versions up to 3.3.1 (later ones don't recognise the files). Trying it from within the IDE I could open the .rrd files even with 3.8. Seems a bit odd to me.


Fabrice Bacchella

unread,
Dec 21, 2020, 6:07:57 AM12/21/20
to rrd4j-discuss
Are you building from a git checkout ?

--
You received this message because you are subscribed to the Google Groups "rrd4j-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rrd4j-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rrd4j-discuss/0538193d-52dc-4c54-90b6-0e66a638a240n%40googlegroups.com.

Jürgen Baginski

unread,
Dec 21, 2020, 10:45:43 AM12/21/20
to rrd4j-discuss
Thanks for the response!

For the older versions I used the code from the "tags" tab, the actual  one was directly forked from git.
In other words, Yes!

I seem to to have gotten via the above above posted Error by setting my actual Java version (11) in the "org.eclipse.jdt.core.prefs" and in the pom.xml (the maven.compiler and .source).
However there are still errors, (as far as I understand only from the test folder), so I'm only a small step further.

Additionally I'm not sure if I should continue with the actual code. My understand WAS that we (the openHAB communitiy) had to stick with 3.3.1, however the above mentioned finding puts that in question. 

Jürgen Baginski

unread,
Dec 22, 2020, 2:24:42 AM12/22/20
to rrd4j-discuss
I found a way to build a .jar without the whole testing. Actually I'm still missing a class, however that is a problem of mine wghich I'm going to solve on my own.

Regarding the "findings" regarding the RRD-inspector (not able to open .rrd files on versions above 3.3.1) it looks as this is only happening on the jars downloaded from "https://repo1.maven.org/maven2/org/rrd4j/rrd4j/". It worked for me on the .jar I created from the 3.9-SNAPSHOT version. 
If you consider that a sort of "bug" file an issue in github, just give me a note!

Thanks and have a healthy christmas!

BTW: RRD4J is great!!

Fabrice Bacchella

unread,
Dec 22, 2020, 2:46:34 AM12/22/20
to rrd4j-discuss
Did you see this in README.md:

The build settings allows to use any jvm, even latest one. But to produce compatible jar, it's recommended to define the path to a compatible runtime.
The cross compilation settings are activated when the property is defined.

    mvn clean compile -Djdk.8.home=.../jdk1.8.0_241.jdk

Tests needs a running mongo instance to succeds. It could be started with:

    docker run --rm  -p 27017:27017 mongo:latest

Could all of this explain some of your problems ?

I don't how can the 3.9-SNAPSHOT can succeed where 3.8 fails, as there is no code change in the latest snapshot.

 Do you have more details about the failure ?

Can you give me more details about the unrecognised files ? It looks like a bug to me.

Jürgen Baginski

unread,
Dec 22, 2020, 3:13:00 AM12/22/20
to rrd4j-discuss

The readme! UPS! I didn't remember this one (got lost in the problem!!)

Using them maven plugin of VSC I found this command "mvn jar:jar -f "d:\RRD4J\rrd4j-3.3.1\pom.xml"", which is working for me.

On the problem:
I'm not saying that it is working ONLY on the snapshot! After being able to create an own .jar I tested only on 3.3.1 and 3.9, both are working!
What I saw was that using a prebuild .jar downloaded from "https://repo1.maven.org/maven2/org/rrd4j/rrd4j/" it did not work on versions  above 3.3.1.
Retested it now with downloaded .jars 3.4 and 3.8, both showing "Exception in thread "main" java.lang.NoClassDefFoundError: org/rrd4j/core/RrdDb" on the console.
Happening on all my .rrd files, even the ones created with the Demo.

Jürgen Baginski

unread,
Dec 22, 2020, 3:14:49 AM12/22/20
to rrd4j-discuss
Funny, I'm having sort of the same problem with "my" jar, I'm missing "org.json".

Fabrice Bacchella

unread,
Dec 22, 2020, 3:42:15 AM12/22/20
to rrd4j-discuss
I don't really understand what are you trying to do.

Build with:
mvn clean package -DskipTests

And run with:
java -jar target/rrd4j-3.9-SNAPSHOT-inspector.jar target/test-classes/demo1.rrd


Jürgen Baginski

unread,
Dec 22, 2020, 4:22:50 AM12/22/20
to rrd4j-discuss

Please consider that I am a Noob when it comes to using Maven, in other words my wordings might  not be correct.
I have created a .jar with the above posted command, will try the one you posted later today as well.
Please consider my initial problem as solved.
Reply all
Reply to author
Forward
0 new messages