Hi,
It is not uncommon in web applications to want to do image operations
on a server.  This usually requires an X11 server if you use the
Swing or AWT classes.

The standard way to do this on a server machine is to run the
"X Virtual Frame Buffer" (Xvfb).  This is a full-fledged X server
which is not mapped to any physical display hardware.  If you run
Xvfb, you will be able to use Swing and AWT in your servlets without
having display hardware on the server.

For more on xvfb, see 

   http://www.XFree86.org.
   http://www.XFree86.org/4.0.1/Xvfb.1.html

There should be many places to download the sources from.

Stephen

At 01:33 PM 11/6/2000 -0000, you wrote:
>
>You should launch X otherwise you can't get a graphics context 
>whether on or off screen. 
>I think.
>:)
>
>Chris.
> 
>
>-----Original Message-----
>From: Didier Bretin [mailto:[EMAIL PROTECTED]]
>Sent: 06 November 2000 10:08
>To: [EMAIL PROTECTED]
>Subject: using javax.swing.ImageIcon with servlet
>
>
>Hello,
>
>  In my servlet I use the package javax.swing.ImageIcon to get the size
>of an image. But apparently, this package need a X11 display. On my server
>I don't have X launched. Do you see how to solve this ? Do I need to use
>another package ?
>
>  Here is my error:
>
>Error: 500
>
>Location: /bib
>Internal Servlet Error:
>
>java.lang.InternalError: Can't connect to X11 window server using
>'<mon serveur>:10.0' as the value of the DISPLAY variable.
>        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>        at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:58)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:120)
>        at
>java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment
>.jav
>a:59)
>        at sun.awt.motif.MToolkit.(MToolkit.java:56)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:120)
>        at java.awt.Toolkit$2.run(Toolkit.java:495)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:488)
>        at javax.swing.ImageIcon.(ImageIcon.java:60)
>        at javax.swing.ImageIcon.(ImageIcon.java:79)
>        at Bibliotheque.reduit(Bibliotheque.java:162)
>        at Bibliotheque.doGet(Bibliotheque.java:56)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
>        at
>org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
>        at
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
>onne
>ctionHandler.java:160)
>        at
>org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
>)
>        at java.lang.Thread.run(Thread.java:475)
>
>Thanks !
>
>
>-- 
>            .------------------------------------------------.
>    .^.     | Didier Bretin, France | [EMAIL PROTECTED]    |
>    /V\     |-----------------------| www.informactis.com    |
>   // \\    |                       `------------------------|
>  /(   )\   | Visit: http://www.multimania.com/cieexcalibur/ |
>   ^^-^^    `------------------------------------------------'
>

Reply via email to