You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Allan Kamau <hu...@yahoo.com> on 2001/06/28 23:02:47 UTC

Providing access to X11 server Using AWT in Linux.

Hi folks,
I need to use features of the AWT implementation for
creating off-screen
images from a servlet.
Using AWT requires the use of the host machine's
graphic system which in my
case is X11 as I am running RH Linux 6.2.
I would like to know how to grant the servlet
container access to the X11
server.

Allan Kamau.


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Re: Providing access to X11 server Using AWT in Linux.

Posted by Tim O'Neil <ti...@xythos.com>.
At 02:26 PM 6/28/2001, you wrote:
>Where do I set DISPLAY, is it in the /etc/profile file
>where I have to set 'DISPLAY=0.0' ?
>And how about setting the xhost access?

In your login script.


Re: Providing access to X11 server Using AWT in Linux.

Posted by Allan Kamau <hu...@yahoo.com>.
Where do I set DISPLAY, is it in the /etc/profile file
where I have to set 'DISPLAY=0.0' ?
And how about setting the xhost access?

--- "Geir Magnusson Jr." <ge...@optonline.net> wrote:
> Allan Kamau wrote:
> > 
> > Hi folks,
> > I need to use features of the AWT implementation
> for
> > creating off-screen
> > images from a servlet.
> > Using AWT requires the use of the host machine's
> > graphic system which in my
> > case is X11 as I am running RH Linux 6.2.
> > I would like to know how to grant the servlet
> > container access to the X11
> > server.
> > 
> 
> I have a related problem.
> 
> All I do is ensure X11 is running on the server, set
> DISPLAY to the
> right thing, and xhost access for it. 
> 
> geir
> 
> -- 
> Geir Magnusson Jr.                          
> geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See
> http://jakarta.apache.org/velocity/
> You have a genius for suggesting things I've come a
> cropper with!


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Re: Providing access to X11 server Using AWT in Linux.

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Allan Kamau wrote:
> 
> Hi folks,
> I need to use features of the AWT implementation for
> creating off-screen
> images from a servlet.
> Using AWT requires the use of the host machine's
> graphic system which in my
> case is X11 as I am running RH Linux 6.2.
> I would like to know how to grant the servlet
> container access to the X11
> server.
> 

I have a related problem.

All I do is ensure X11 is running on the server, set DISPLAY to the
right thing, and xhost access for it. 

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Re: Providing access to X11 server Using AWT in Linux.

Posted by Hunter Hillegas <li...@lastonepicked.com>.
FWIW, Java1.4 has headless AWT.

> From: pete <pe...@claudia.dyn.dhs.org>
> Reply-To: tomcat-user@jakarta.apache.org
> Date: Fri, 29 Jun 2001 10:22:33 +1200
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Providing access to X11 server Using AWT in Linux.
> 
> Allan,
> 
> if the X server is running while tomcat is running - i.e. your server
> has a GUI interface, then tomcat should be able to use it, as DISPLAY
> defaults to 127.0.0.1:0 and connections from Xclients on localhost
> should be accepted.
> 
> If X is on your machine, but you aren't actually running the X Server,
> then AWT won't be able to get a context to draw with.
> 
> You have several options.
> 
> 1) Just run X. Start up a minimal GUI on your machine, and leave it.
> This can eat resources, however.
> 
> 2) Use Xvfb, shipped with XFree86 3.3.5?+ and 4.x.x THis is a 'Virtual
> framebuffer' that gives you an X Server you can use with AWT without any
> actual on-screen display. I have used this for java apps on a headless
> SGI machine running IRIX, and it worked well. BE aware that the
> bit-depth you set the display to will affect the results of your graphic
> drawing operations - i.e. my GIFs have greadient fills, and i notice
> major 'banding' if i use a 16bit display as compared to a 32bit display.
> 
> 3) Use VNC Server. This gives you an X server too, but i think Xvfb
> would be preferable.
> 
> 4) There are AWT libraries floating around that do not require X. I
> forget who supplies these.
> 
> 5) Use another machine's X Server. I wouldn't recommend this for
> production use (since graphic operations will require slow network
> operations) but it is a nifty demonstration of why X is cool. set
> DISPLAY to remotemachine:0 and on the remote machine, type 'xhost
> +yourmachine' from a xterm or something. xhost is the command that adds
> permission for machines to access the X server.
> 
> in cases 2 and 3, you would need to, as part of your tomcat start
> script, or just sometime before you start tomcat, to start Xvfb with a
> display number of say, 2, and then set an environment variable to point
> to it e.g. export DISPLAY=:2
> 
> If, for some reason, you are actually having problems connecting to an
> already running display, make sure you have a DISPLAY environment
> variable set in whatever shell tomcat is running in.
> 
> This should get you up and running.
> 
> -Pete
> 
>> Hi folks,
>> I need to use features of the AWT implementation for
>> creating off-screen
>> images from a servlet.
>> Using AWT requires the use of the host machine's
>> graphic system which in my
>> case is X11 as I am running RH Linux 6.2.
>> I would like to know how to grant the servlet
>> container access to the X11
>> server.
>> 
>> Allan Kamau.
>> 
>> 
>> __________________________________________________
>> Do You Yahoo!?
>> Get personalized email addresses from Yahoo! Mail
>> http://personal.mail.yahoo.com/
> 
> 
> 


Re: Providing access to X11 server Using AWT in Linux.

Posted by pete <pe...@claudia.dyn.dhs.org>.
Allan,

if the X server is running while tomcat is running - i.e. your server 
has a GUI interface, then tomcat should be able to use it, as DISPLAY 
defaults to 127.0.0.1:0 and connections from Xclients on localhost 
should be accepted.

If X is on your machine, but you aren't actually running the X Server, 
then AWT won't be able to get a context to draw with.

You have several options.

1) Just run X. Start up a minimal GUI on your machine, and leave it. 
This can eat resources, however.

2) Use Xvfb, shipped with XFree86 3.3.5?+ and 4.x.x THis is a 'Virtual 
framebuffer' that gives you an X Server you can use with AWT without any 
actual on-screen display. I have used this for java apps on a headless 
SGI machine running IRIX, and it worked well. BE aware that the 
bit-depth you set the display to will affect the results of your graphic 
drawing operations - i.e. my GIFs have greadient fills, and i notice 
major 'banding' if i use a 16bit display as compared to a 32bit display.

3) Use VNC Server. This gives you an X server too, but i think Xvfb 
would be preferable.

4) There are AWT libraries floating around that do not require X. I 
forget who supplies these.

5) Use another machine's X Server. I wouldn't recommend this for 
production use (since graphic operations will require slow network 
operations) but it is a nifty demonstration of why X is cool. set 
DISPLAY to remotemachine:0 and on the remote machine, type 'xhost 
+yourmachine' from a xterm or something. xhost is the command that adds 
permission for machines to access the X server.

in cases 2 and 3, you would need to, as part of your tomcat start 
script, or just sometime before you start tomcat, to start Xvfb with a 
display number of say, 2, and then set an environment variable to point 
to it e.g. export DISPLAY=:2

If, for some reason, you are actually having problems connecting to an 
already running display, make sure you have a DISPLAY environment 
variable set in whatever shell tomcat is running in.

This should get you up and running.

-Pete

> Hi folks,
> I need to use features of the AWT implementation for
> creating off-screen
> images from a servlet.
> Using AWT requires the use of the host machine's
> graphic system which in my
> case is X11 as I am running RH Linux 6.2.
> I would like to know how to grant the servlet
> container access to the X11
> server.
> 
> Allan Kamau.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/