Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts not working on OpenJDK / Zulu JDK #421

Closed
kaikreuzer opened this issue Feb 10, 2017 · 5 comments
Closed

Charts not working on OpenJDK / Zulu JDK #421

kaikreuzer opened this issue Feb 10, 2017 · 5 comments

Comments

@kaikreuzer
Copy link
Member

Using Zulu JDK / OpenJDK, using the chart servlet results in

java.lang.NullPointerException
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)[:1.8.0_112]
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)[:1.8.0_112]
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107)[:1.8.0_112]
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)[:1.8.0_112]
	at sun.font.SunFontManager$2.run(SunFontManager.java:431)[:1.8.0_112]
	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_112]
	at sun.font.SunFontManager.<init>(SunFontManager.java:376)[:1.8.0_112]
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35)[:1.8.0_112]
	at sun.awt.X11FontManager.<init>(X11FontManager.java:57)[:1.8.0_112]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.8.0_112]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)[:1.8.0_112]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0_112]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)[:1.8.0_112]
	at java.lang.Class.newInstance(Class.java:442)[:1.8.0_112]
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)[:1.8.0_112]
	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_112]
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)[:1.8.0_112]
	at java.awt.Font.getFont2D(Font.java:491)[:1.8.0_112]
	at java.awt.Font.defaultLineMetrics(Font.java:2176)[:1.8.0_112]
	at java.awt.Font.getLineMetrics(Font.java:2283)[:1.8.0_112]
	at java.awt.font.TextLayout.fastInit(TextLayout.java:598)[:1.8.0_112]
	at java.awt.font.TextLayout.<init>(TextLayout.java:393)[:1.8.0_112]
	at com.xeiam.xchart.internal.chartpart.Axis.getSizeHint(Axis.java:138)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at com.xeiam.xchart.internal.chartpart.Axis.paint(Axis.java:169)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at com.xeiam.xchart.internal.chartpart.AxisPair.paint(AxisPair.java:130)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at com.xeiam.xchart.internal.chartpart.ChartPainter.paint(ChartPainter.java:94)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at com.xeiam.xchart.Chart.paint(Chart.java:105)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at org.eclipse.smarthome.ui.internal.chart.DefaultChartProvider.createChart(DefaultChartProvider.java:225)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at org.eclipse.smarthome.ui.internal.chart.ChartServlet.doGet(ChartServlet.java:190)[136:org.eclipse.smarthome.ui:0.9.0.b4]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)[19:javax.servlet-api:3.1.0]

There are similar reports on the web.
I already tried

apt-get install libfontconfig1 fontconfig ttf-dejavu

but without effect :-(

@watou
Copy link
Contributor

watou commented Feb 12, 2017

Another report with a similar stacktrace.

@kaikreuzer
Copy link
Member Author

I saw that one, but I didn't find their referenced commit that fixed the issue for them.

@watou
Copy link
Contributor

watou commented Feb 12, 2017

referenced commit that fixed the issue for them.

Yes, it would be helpful if they referenced the commits that fix issues. ;-)

This might be it, basically installing some fonts so OpenJDK has fonts.

@kaikreuzer
Copy link
Member Author

Ok, I found the solution: As we are running 32-bit JVM, we have to install

apt-get install fontconfig:armhf

on the Pine64 and all is good!

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/npe-in-fontmanagerfactory-when-opening-charts/117077/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants