V
vizlab
Dear all:
My servlets try to use some graphics. My JVM is 1.4.x.
At first, the servlet cannot show the graphics stuff. After I set
CATALINA_OPTS="-Djava.awt.headless=true", the servlets work "half
way". That's, they can show some graphics stuff, but not all. Some
graphics stuff, such as background, is missed. And I got the error
message below:
java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
at java.awt.Window.<init>(Window.java:267)
at java.awt.Frame.<init>(Frame.java:398)
at java.awt.Frame.<init>(Frame.java:363)
at javax.swing.SwingUtilities$1.<init>(SwingUtilities.java:1623)
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1619)
at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1511)
at cobre.flowchart.FlowChart.loadBackdrop(FlowChart.java:1070)
at cobre.flowchart.FlowChart.load(FlowChart.java:1007)
I am surprised that the CATALINA_OPTS setting solves the graphics
problem only half way!
The problematic function is Toolkit.getGraphics().
I searched the related postings and found some possible
solutions:
(1) install xlib and set LD_LIBRARY_PATH to point to the lib. (I
have X11 installed, and tried to set LD_LIBRARY_PATH but got the same
error).
(2) set DISPLAY variable. (I set "export
DISPLAY=xxx.xxx.xxx.xxx:0.0" but no luck.).
(3) Use Xvfb to work around Headless. (I set "Xvfb :1 -screen 0
1600x1200x32", the system reported "Server is already active for
display 1...").
Did I do something wrong?
Or what else can I try?
Very grateful for your help.
Best Regards
Lian
My servlets try to use some graphics. My JVM is 1.4.x.
At first, the servlet cannot show the graphics stuff. After I set
CATALINA_OPTS="-Djava.awt.headless=true", the servlets work "half
way". That's, they can show some graphics stuff, but not all. Some
graphics stuff, such as background, is missed. And I got the error
message below:
java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
at java.awt.Window.<init>(Window.java:267)
at java.awt.Frame.<init>(Frame.java:398)
at java.awt.Frame.<init>(Frame.java:363)
at javax.swing.SwingUtilities$1.<init>(SwingUtilities.java:1623)
at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1619)
at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1511)
at cobre.flowchart.FlowChart.loadBackdrop(FlowChart.java:1070)
at cobre.flowchart.FlowChart.load(FlowChart.java:1007)
I am surprised that the CATALINA_OPTS setting solves the graphics
problem only half way!
The problematic function is Toolkit.getGraphics().
I searched the related postings and found some possible
solutions:
(1) install xlib and set LD_LIBRARY_PATH to point to the lib. (I
have X11 installed, and tried to set LD_LIBRARY_PATH but got the same
error).
(2) set DISPLAY variable. (I set "export
DISPLAY=xxx.xxx.xxx.xxx:0.0" but no luck.).
(3) Use Xvfb to work around Headless. (I set "Xvfb :1 -screen 0
1600x1200x32", the system reported "Server is already active for
display 1...").
Did I do something wrong?
Or what else can I try?
Very grateful for your help.
Best Regards
Lian