• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help configuring X11 server

 
Vanessa Hall
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

We are using JBoss on Red Hat Linux with Java SDK version 1.3. One of our session EJBs does some manipulation of JPEG files, and thus uses the java.awt graphics and image objects. This causes the "can't connect to X11 server" exception to occur, unless we first run xhost +. (we cannot use the java.awt.headless feature because we are stuck on Java 1.3).

Our problem/question is that we can only get xhost + to run successfully if it is run from an xterm. Since this is a server, we cannot have any dependencies on a GUI. The requirement is that the machine boot up and run our JBoss application without any intervention. It is not acceptible to have a person log in and start up JBoss from an xterm.

Can anyone tell me how to configure the X server so that the machine will boot up with JBoss able to access X11? Any help would be greatly appreciated.

Thanks!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best solution in my opinion (and also perhaps the easiest to implement) is to run a special X server for JBoss to use. You can use Xvfb, the X Virtual Frame Buffer, which you should already have on your system. Start it like this (do this in a startup script if you like

/usr/X11R6/bin/Xvfb -auth /dev/null :5 2>/dev/null &

Now you've got a second X server on display :5. Then just put something like

export DISPLAY=:5

into the script you use to startup JBoss, and Bob's your uncle!
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So long as you are stuck on JDK 1.3, I don't believe there is a solution. The condition lies between Sun's AWT library in this version, which relies on an underlying X server.

What you need in this case is either a) an AWT library that does not require an Xserver; or b) an Xserver that does not require display hardware to run.

For a), consider an alternate AWT library such as PJA.

For b), take a look at Xvfb, a virtual Xserver that runs without having a display adapter present.
 
Vanessa Hall
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help. We went with the Xvfb solution and it works great.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic