[Nix-dev] Help debugging a NPE in jenkins test in X11FontManager

Corey O'Connor coreyoconnor at gmail.com
Fri Aug 31 12:01:56 CEST 2012


Hi all,
I'm working on building a deriviation for the jenkins continuous
integration system.
I have only a single test failing during the build. The test fails due
to a NullPointerException  in
sun.awt.X11FontManager.getDefaultPlatformFont.

>From searching this appears to have something to do with fontconfig. I
have fontconfig in the buildInputs and provide a FONTCONFIG_FILE with
an appropriate selection of fonts. I have also tried using different
jdks. However it's unclear if maven uses the jdk in scope or a
specific jdk.

Any help?

Source at time of writing:
https://github.com/coreyoconnor/nixpkgs/tree/d8f154f493c83b56feab34d14e724a197c285ce5/pkgs/development/tools/continuous-integration/jenkins

-Corey O'Connor
coreyoconnor at gmail.com
http://corebotllc.com/

Full stack trace:
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 sun.font.SunFontManager.getInstance(SunFontManager.java:245)
        at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
        at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:789)
        at org.jfree.text.TextFragment.calculateDimensions(TextFragment.java:229)
        at org.jfree.text.TextLine.calculateDimensions(TextLine.java:190)
        at org.jfree.text.TextBlock.calculateDimensions(TextBlock.java:171)
        at org.jfree.chart.block.LabelBlock.arrange(LabelBlock.java:249)
        at org.jfree.chart.block.BorderArrangement.arrangeNN(BorderArrangement.java:208)
        at org.jfree.chart.block.BorderArrangement.arrange(BorderArrangement.java:135)
        at org.jfree.chart.block.BlockContainer.arrange(BlockContainer.java:181)
        at org.jfree.chart.block.CenterArrangement.arrangeNN(CenterArrangement.java:284)
        at org.jfree.chart.block.CenterArrangement.arrange(CenterArrangement.java:98)
        at org.jfree.chart.block.BlockContainer.arrange(BlockContainer.java:181)
        at org.jfree.chart.block.FlowArrangement.arrangeNN(FlowArrangement.java:365)
        at org.jfree.chart.block.FlowArrangement.arrangeRR(FlowArrangement.java:283)
        at org.jfree.chart.block.FlowArrangement.arrange(FlowArrangement.java:158)
        at org.jfree.chart.block.BlockContainer.arrange(BlockContainer.java:181)
        at org.jfree.chart.title.LegendTitle.arrange(LegendTitle.java:486)
        at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1317)
        at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1208)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1396)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1376)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1361)
        at hudson.model.LoadStatisticsTest.testGraph(LoadStatisticsTest.java:70)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:243)
        at junit.framework.TestSuite.run(TestSuite.java:238)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)


More information about the nix-dev mailing list