Rrd4j Graphs not working

I have a 2.0.0 system that has been running faultlessly for 2.5 years on a Raspberry Pi 3. Thank you OpenHAB and Raspberry Pi!

I am going to move to 2.4.0 so I’ve setup a parallel system to test using the same bindings etc. and configuration files.

New Hardware: Raspberry Pi 3A+
New Software: Noobs Lite. I then used openhabian-config to install Zulu Java (63) and OpenHAB stable(64) only
openjdk version “1.8.0_222”
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)

I had to relearn OpenHAB but eventually I had everything working except for the RRd4j graphs. It appears the rrd files are being populated but there are no graph images.

The error I get in the openhab.log or when browsing to a graph is:

java.lang.NoClassDefFoundError: Could not initialize class org.rrd4j.graph.RrdGraphConstants
	at org.rrd4j.graph.RrdGraphDef.<init>(RrdGraphDef.java:80)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.createChart(RRD4jChartServlet.java:257)
	at org.openhab.persistence.rrd4j.internal.charts.RRD4jChartServlet.service(RRD4jChartServlet.java:157)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	etc. etc.

Any suggestions would be much appreciated. Thanks


Sorry I do not have your answer.
Since you are rebuilding your system it may make sense to base the new one on 2.5M2. There were many changes structurally between 2.4 and what will become 2,5.
The structural changes are part of what has delayed the 2.5 release but most of the changes have been implemented. That would help future proof your new system.

Thanks Bruce, probably a good suggestion.

I just hope the manual configuration options and MQTT 1.00 binding remains, I still haven’t figured out things and channels yet!

MQTT 1 binding is still available.
Just be aware there is discussion about removing the v1 binding compatibility layer for OH 3.
From what I understand the MQTT v1 binding has more features that the v2 one, currently.

Thanks again. I will have a play with the MQTT 2 binding at a later date.

On a separate SD card I have now installed as before but using the testing version on option 41 of openhabian. Seems to build much quicker and it gives me version: openHAB 2.5.0.M2 Milestone Build

I still get the same error message when using a graph.

All I can suggest is first verify your config by checking the current documentation.

Would you show us your sitemap line(s) for these graphs?
Just to reassure, I have sitemap charts working fine under Windows

This looks relevant - note EXTRA_JAVA_OPTS_COMMON

Taking the Hot Water Temperature graph:


Number Temperature_Hot_Water “Hot Water Temperature [%s]” {mqtt="<[mybroker:home/hotwater/temperature:state:default]"}


Text item=Temperature_Hot_Water

persistence: rrd4j.persist

Strategies {
everyMinute : “0 * * * * ?”
Items {
Temperature_Hot_Water, Hot_Water_Status, Heating_Status, Pressure_Outdoor, Weather_Chart* : strategy = everyMinute, restoreOnStartup

HABpanel Chart Settings:
Type: RRD4j(rrd4j persistence service only)
Openhab item: #Temperature_Hot_Water

Oh, habpanel not sitemap.
I can only suggest finding EXTRA_JAVA_OPTS_COMMON and seeing what it is set to.

Thanks for your help.

If you mean the openhab file in the /etc/default directory:

EXTRA_JAVA_OPTS="-Xms250m -Xmx350m"

I keep seeing this said but no one can point at specifics. As far as I’m aware, the MQTT 2.5 binding is feature complete with MQTT 1.x, plus it does a lot more. If there are features that are missing, we need to have issues filed so those features can be added. MQTT 2.5 has many more features than MQTT 1.x including:

  • automatic discovery of topics and creation of Things that follow the Homie or Home Assistant topic structure/standards
  • the ability to define the retained flag on a topic by topic basis
  • chaining transformations

For all intents and purposes development on MQTT 1.x has ended. Even if the compatibility layer doesn’t get removed in OH 3, it will break at some point and no one will fix it.

You have plenty of time to look at it.

Unfortunately I don’t have any ideas for the problem listed in the OP. But I’m starting to get tired of fighting the FUD against the MQTT 2.5 binding. Everyone keeps mentioning these missing features but no one can point at any specifics and no one is filing issues to have them added.

Not sure but is the Event Bus Binding feature in MQTT 2?

There is the functional equivalent. See MQTT 2.5 Event Bus. This is also somewhat covered in the MQTT Binding docs I think. There was a thread where I helped work this new approach out.

I can confirm it works and works well.

The way that the MQTT1 binding implements the EventBus feature is no longer allowed in OH 2.

OK, I did not see it mentioned on the doc page here.

The HABPanel charts (Type RRD4J and n3) should work without any problems (I’m using the n3 type,and did checked the RRD4J type this time, I’m on 2.4 stable).
@rossko57: Shouldn’t the posted issue be fixed and included since Feb’2016? I do not know of a way to check the used EXTRA_JAVA_OPTS_COMMON of a running openhab instance (isn’t that a setting in the source code, not visible on a running instance?). IMHO one could only set the EXTRA_JAVA_OPTS in the file /etc/default/openhab2. On my system there is none set.

It used to be there, well at least on the Generic MQTT Thing subpage. I don’t see it there right now either. Maybe it got cut out.

Thanks again for all the replies.

I thought I would try again this time with a simple system built from scratch.

As before, Raspbian Lite (Buster) via NOOBS, then use openhabian-config to install Zulu Java and Openhab 2.4 release.

Then installed MQTT version 2, added 2 MQTT items (temperature in, switch out) and setup things and channels via Paper UI. Eventually I got it working but I prefer the much simpler version 1 binding.

I than added a simple rrd4j graph on the temperature. This gave the same error message, so it isn’t my old configuration.

I then searched openHAB community again and found a 2013 thread with a different problem but a similar Java error where the recommendation was to install but not use Influx/Grafana. So using openhabian-config I installed Influx/Grafana.

Guess what, my simple graph then worked! I returned to my sd card with the my full system and openHAB 2.5.0.M2, repeated the install and again all the graphs worked.

Was there any indication in that other thread that an issue was filed? If not one does need to be filed so this problem can be fixed. See How to file an Issue

Rather like this business

If it is different symptom of same cause, different due to habpanel charts rather than sitemap charts, the openhabian fix is in

1 Like