java + X11 issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am trying to run a J2EE application server and web app on my RedHat 7.2 machine. For certain functionality, the server side application code creates a servlet which creates a JFrame (probably to render some font object). I've learned that this means the JVM needs to access the native window API, in my case an XFree86 server.

Everything is fine if run the application from the command line after running "xhost +" (or something more restrictive) and exporting the DISPLAY variable.

Unfortunately if I try to start the appliation at boot time as a daemon, the Xserver refuses to let the application connect.

It refuses the connection even if I do an "xhost +" before trying to browse the application.

I have tried to make the Xserver more permissive by uncommenting the line in /etc/X11/xdm/Xaccess:

* #any host can get a login window

but this seems to have no effect. I created a /etc/X0.hosts file which contains several combinations of the localhost name. I have also tried to run xauth in the start script a la "xauth add $DISPLAY . `mcookie`" to no avail...

I'm familiar with some of the options involving Xfvb, PJA and JDK 1.4 headless mode, though I haven't tried any of them yet. Given that I am indeed running an Xserver on the application server node, it must be configurable to work with java, no?

System info:

XFree86-4.1.0-03

Redhat 7.2 on 550Mhz PIII, 2.4.7-10 kernel

Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)

Partial stack trace of the java exception:

Attributes

javax.servlet.jsp.jspException

Stack Trace

java.rmi.RemoteException:

Error in ejbCreate:; nested exception is: java.lang.InternalError:

Can't connect to X11 window server using  'localhost:0.0' as the value of the DISPLAY variable. at

...

Caused by: java.lang.Internal

Error: Can't connect to X11 window server using 'localhost:0.0' as

the value of the DISPLAY variable. at s

sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at

sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:126) at

java.lang.Class.forName0(Native Method) at

java.lang.Class.forName(Class.java:130) at

java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment

(GraphicsEnvironment.java:62) at java.awt.Window.init(Window.java:223) at

java.awt.Window.(Window.java:267) at java.awt.Frame.(Frame.java:398) at

java.awt.Frame.(Frame.java:363) at jet.bean.JREngine.(jet/bean/JREngine) at

....ReportBean.ejbCreate(ReportBean.java:147) at

....ReportBean_5yy2t2_Impl.ejbCreate

(ReportBean_5yy2t2_Impl.java:112)

...

 

What is my next step? If any one has Linux, X11 and/or java expertise to share, I would greatly appreciate your help.

Andy



Join the world’s largest e-mail service with MSN Hotmail. Click Here
_______________________________________________ Newbie@XFree86.Org *** To unsubscribe , or change message options, see: http://XFree86.Org/mailman/listinfo/newbie

[Index of Archives]     [XFree86]     [Xfree86 Xpert]     [X.org]     [IETF Annouce]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Picture Sharing]     [Linux Security]     [Linux RAID]

  Powered by Linux