• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help configuring X11 server

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help. We went with the Xvfb solution and it works great.
 
I am displeased. You are no longer allowed to read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic