To crate my Image and Graphics, I am using:
//class MyGraphicsTest
frame = new Frame(); //line 38
frame.addNotify();
img = frame.createImage(WIDTH, HEIGHT);
g = img.getGraphics();
All works sweet on my NT/Tomcat servlet development environment
But when I take it over to my Linux/Tomcat machine I get:
java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment
.java:58)
at java.awt.Window.(Window.java:186)
at java.awt.Frame.(Frame.java:315)
at java.awt.Frame.(Frame.java:262)
at MyGraphicsTest.doGet(MyGraphicsTest.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
Can anyone explain why my 'WORA' servlet is failing on the Linux serfer?
And, of course, can you offer me a solution or work around?
[...]
>All works sweet on my NT/Tomcat servlet development environment
>
>But when I take it over to my Linux/Tomcat machine I get:
>
>java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
>the value of the DISPLAY variable.
Java versions before 1.4 required an X server. See
http://www.geocities.com/marcoschmidt.geo/java-image-coding.html#X
[...]
Regards,
Marco
--
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
I found a suitable workaround using the PJA at:
http://www.eteks.com/pja/en/
"Marco Schmidt" <marcos...@geocities.com> wrote in message
news:ebaq6u8v5rve0assi...@4ax.com...
> Many thanks.
>
> I found a suitable workaround using the PJA at:
> http://www.eteks.com/pja/en/
Well... JDK 1.4 is out now, so that's another thing that can be used. And,
yes, the Linux version is released too. Just the Mac OS-X one is still in
beta.
--
Jon A. Cruz
"Can't a man even clean up his work area without inadvertently conjuring
up a pack of lightning-breathing ocelots?" - Edward Whitson