Opened 7 years ago

Closed 7 years ago

#915 closed defect (not a bug)

error when opening graphs page in 0.9.5-4

Reported by: DISABLED Owned by:
Priority: minor Milestone: 0.9.6
Component: apps/console Version: 0.9.5
Keywords: Cc:
Parent Tickets: Sensitive: no

Description (last modified by zzz)

Error 500: /viewstat.jsp Server Error

java.lang.NullPointerException
     at sun.awt.X11FontManager.getDefaultPlatformFont(X11FontManager.java:779)
     at sun.font.SunFontManager$2.run(SunFontManager.java:428)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.font.SunFontManager.<init>(SunFontManager.java:371)
     at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
     at java.lang.Class.newInstance0(Class.java:372)
     at java.lang.Class.newInstance(Class.java:325)
     at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:80)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:71)
     at java.awt.Font.getFont2D(Font.java:489)
     at java.awt.Font.access$000(Font.java:223)
     at java.awt.Font$FontAccessImpl.getFont2D(Font.java:227)
     at sun.font.FontUtilities.getFont2D(FontUtilities.java:183)
     at sun.font.StandardGlyphVector.initFontData(StandardGlyphVector.java:1126)
     at sun.font.StandardGlyphVector.init(StandardGlyphVector.java:1115)
     at sun.font.StandardGlyphVector.<init>(StandardGlyphVector.java:172)
     at java.awt.Font.getStringBounds(Font.java:2387)
     at java.awt.Font.getStringBounds(Font.java:2297)
     at java.awt.Font.getStringBounds(Font.java:2331)
     at org.jrobin.graph.ImageWorker.getStringWidth(Unknown Source)
     at org.jrobin.graph.RrdGraph.getSmallFontCharWidth(Unknown Source)
     at org.jrobin.graph.RrdGraph.initializeLimits(Unknown Source)
     at org.jrobin.graph.RrdGraph.createGraph(Unknown Source)
     at org.jrobin.graph.RrdGraph.<init>(Unknown Source)
     at net.i2p.router.web.SummaryRenderer.render(SummaryRenderer.java:232)
     at net.i2p.router.web.SummaryListener.renderPng(SummaryListener.java:213)
     at net.i2p.router.web.SummaryListener.renderPng(SummaryListener.java:197)
     at net.i2p.router.web.StatSummarizer.locked_renderPng(StatSummarizer.java:219)
     at net.i2p.router.web.StatSummarizer.renderPng(StatSummarizer.java:194)
     at net.i2p.router.web.jsp.viewstat_jsp._jspService(viewstat_jsp.java:125)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
     at net.i2p.router.web.LocaleWebAppHandler.handle(LocaleWebAppHandler.java:99)
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
     at org.eclipse.jetty.server.Server.handle(Server.java:367)
     at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
     at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
     at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
     at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
     at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
     at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
     at java.lang.Thread.run(Thread.java:722)
     

I2P version: 0.9.5-4
Java version: Oracle Corporation 1.7.0 (OpenJDK Runtime Environment 1.7.0-root_2011_12_03_14_00-b00)
Wrapper version: 3.5.15
Server version: 7.6.10.v20130312
Servlet version: Jasper JSP 2.1 Engine
Platform: FreeBSD i386 9.1-RELEASE
Processor: Athlon (Thoroughbred) (athlon)
Jbigi: Locally optimized native BigInteger library loaded from file
Encoding: US-ASCII
Charset: US-ASCII

Subtickets

Change History (3)

comment:1 Changed 7 years ago by zzz

Component: unspecifiedapps/console
Description: modified (diff)

I thought it might be related to my recent work on ticket #890 - but no.

A quick search shows that it's caused by a missing font package, together with Oracle's refusal to throw a decent error message instead of an NPE. Please investigate and see if you can install a font package that will fix it. Please report results.

Links and quotes:


http://osdir.com/ml/jdk7-development-java/2012-11/msg00001.html

I seen this failure on 32bit OpenJDK/IcedTea installed on 64bit system.
The problem was caused by wrong architecture (i386/x86_64) of libfreetype
library. If you have 32bit JDK @ 64bit RHEL, please make sure the
libfreetype is 32bit/i386 too.


https://bugzilla.redhat.com/show_bug.cgi?id=862355

dditional info:

The workaround is to install any font package, for example:

# yum install dejavu-sans-fonts

After that fc-list will detect the new fonts and the Java program will run correctly (if given a correct .ttf file).


http://mail.openjdk.java.net/pipermail/2d-dev/2012-November/002843.html


https://www.openshift.com/forums/openshift/need-to-install-fonts

add the fontconfig package…


http://stackoverflow.com/questions/8109607/headless-continuous-integration-with-jenkins


On my fedora 17 64Bit machine, I had OpenJDK 1.7 installed and I yum installed Jenkins which was having the same issue. Setting up -Djava.awt.headless=true did not help.


https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem

Finally found a solution.

Believe it or not, it was actually just a matter of installing ttf-dejavu font!

Finally solved the issue by installing dejavu-sans-fonts:

yum install dejavu-sans-fonts


comment:2 Changed 7 years ago by zzz

Catch the NPE in 0.9.5-7 rev d2d54890899eebb887fecc8231243b0f405563b5 .

This will still spew errors in the log the first time you load the graphs page. But after that the graph generation will be disabled until restart.

comment:3 Changed 7 years ago by zzz

Resolution: not a bug
Status: newclosed

Closing with the workaround above, but it's really a java bug.

Note: See TracTickets for help on using tickets.