You need to install the X11 libs for X. The Java Advanced Imaging API calls the X libs on Linux to get font and scaling data. You can try setting the JVM java.awt.headless" property to true. This will work for some instances. But installing the X libs installed on your server is a more reliable option.


To set your java.awt.headless as true use the following line.
System.setProperty("java.awt.headless", "true");



System.setProperty("java.awt.headless", "true");

Mauricio Fernandez A. wrote:

Hello

I have a web App with some jsp´s showing graphics generated by jfreechart,
in my windows dev station it works fine but in my linux production server it
was working fine to some days ago and now it doesn´t.

I have Tomcat 5.5.9, JDK 1.5.0_04, Red Hat Linux on a rack

Now i obtain a ServletException generated by this reason (sorry to send the
trace but I want to be specific):

java.lang.NoClassDefFoundError
        
sun.java2d.SunGraphicsEnvironment.addDirFonts(SunGraphicsEnvironment.java:7
22)
        
sun.java2d.SunGraphicsEnvironment.registerFontsInDir(SunGraphicsEnvironment
.java:602)
        
sun.java2d.SunGraphicsEnvironment.access$200(SunGraphicsEnvironment.java:58
)
        sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:174)
        java.security.AccessController.doPrivileged(Native Method)
        sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:94)
        sun.awt.X11GraphicsEnvironment.<init>(X11GraphicsEnvironment.java:164)
        sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcce
ssorImpl.java:39)
        
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstru
ctorAccessorImpl.java:27)
        java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        java.lang.Class.newInstance0(Class.java:350)
        java.lang.Class.newInstance(Class.java:303)
        
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironmen
t.java:68)
        java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141)
        org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1243)
        org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1223)
        org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:173)
        org.jfree.chart.ChartUtilities.saveChartAsPNG(ChartUtilities.java:328)
        org.jfree.chart.ChartUtilities.saveChartAsPNG(ChartUtilities.java:299)
        
com.Prueba.comandos.Graficador2.crearBarChart3DVertical(Graficador2.java:21
1)
        
org.apache.jsp.jsp.grafica_jsp._jspService(org.apache.jsp.jsp.grafica_jsp:1
67)

Thanks

MauricioF


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Brian Cook
Digital Services Analyst
Print Time Inc.
[EMAIL PROTECTED]
913.345.8900

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to