You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Micael Padraig Og mac Grene <ca...@harbornet.com> on 2002/05/13 02:03:57 UTC
X11 Windows System and Tomcat
This is maybe not a pure Tomcat question, but I am running a servlet on
Tomcat which uses javax.swing, to resize jpeg images, but which does not,
of course, want to display those images. This throws an exception, due to
a bug in the JDK 1.4.
The exception is:
Exception in thread "main" 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.<clinit><>(11GraphicsEnvironment.java:126)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at java.awt.Toolkit#2.run(Toolket.java:712)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
at javax.swing.ImageIcon.(init>(ImageIcon.java:81)
at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
ps aux reveals: "/etc/X11/X -auth /var/lib/kdm/authfiles/A:0-0Dqymv"
Anyone know the command I need to use to solve this, if any? I would
prefer not to use a virtual X11 system, or to build a substitute Toolkit
for the JDK.
Thanks,
Micael
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: X11 Windows System and Tomcat
Posted by Michael Jennings <mi...@southgatesoftware.com>.
Modify the startup script for tomcat so that the java.awt.headless system
property is set
to true.
Example:
java -Djava.awt.headless=true -cp $CLASSPATH $MAINCLASS
This will tell the Java virtual machine to use a non-X11 toolkit for images
etc.
----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: <to...@jakarta.apache.org>
Cc: "Teresa Rebo" <te...@teresarebo.com>
Sent: Sunday, May 12, 2002 5:03 PM
Subject: X11 Windows System and Tomcat
> This is maybe not a pure Tomcat question, but I am running a servlet on
> Tomcat which uses javax.swing, to resize jpeg images, but which does not,
> of course, want to display those images. This throws an exception, due to
> a bug in the JDK 1.4.
>
> The exception is:
>
>
> Exception in thread "main" 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.<clinit><>(11GraphicsEnvironment.java:126)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:130)
> at java.awt.Toolkit#2.run(Toolket.java:712)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:703)
> at javax.swing.ImageIcon.(init>(ImageIcon.java:81)
> at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
>
> ps aux reveals: "/etc/X11/X -auth /var/lib/kdm/authfiles/A:0-0Dqymv"
>
> Anyone know the command I need to use to solve this, if any? I would
> prefer not to use a virtual X11 system, or to build a substitute Toolkit
> for the JDK.
>
> Thanks,
>
> Micael
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>