1834450 Members
2123 Online
110067 Solutions
New Discussion

Re: java graphics poblem

 
paramesh
Occasional Contributor

java graphics poblem

Hi,
Can any one help me in solving this java graphics problem.I am trying to run a java program after initializing the frame as follows:
Frame f=new Frame();
f.setVisible();

inside the main method.

When I run it on hp-ux I am facing the following error:
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window
server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:1
30)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
ronment.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 stest.main(stest.java:9)

Your reply will be highly appreciated.

regards,
Params
6 REPLIES 6
Alex Glennie
Honored Contributor

Re: java graphics poblem

complete guess but it would appear the program is having problems connecting to an Xserver ?

':0.0' is the default display used if a DISPLAY enviroment variable is not set.

So I'd be asking what h/w are you using this on - an hpux server without a graphics head by any chance ? you may need xvfb if that's the case .....

and if not ie you are running it on either a local graphics card installed in an hpux server or workstation or via a PC Xemulator, then is the DISPLAY variable set appropriately ?
Benedict
Occasional Advisor

Re: java graphics poblem

Hi Alex,
How do I find whether the xvfb is available or whether the server has an internal graphics card?
Also need more information abt how to start the XServer?

regards,
Params
T G Manikandan
Honored Contributor

Re: java graphics poblem

The java program is trying to open the the grahical window.

First you have to install some x-windows application on your PC.

Like the Xmanager.
You can download it by searching in google.com

"Xmanager downloads"

Install it.
run XManager
you will receive xdmcp broadcasts from the unix servers that are running CDE.
Then you can login into the appropriate server.
Then do a
$DISPPLAY=:0.0;export DISPLAY
(ip-add-->ip-address of the PC)

here it the link for the xmanager(x-windows application)

http://download.com.com/3000-2340-6128455.html?tag=list

THanks
Yogeeraj_1
Honored Contributor

Re: java graphics poblem

hi,
please find attached my notes on "Installing and Configuring the Virtual Frame Buffer X Server "

Hope this helps!

Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Benedict
Occasional Advisor

Re: java graphics poblem

Hi Manikandan,
I installed the XManager tool in my local pc and connected to my HPUX server, and given the DISPLAY env. variable as my local ip:0.0 but the error persists....and one more thing is that my program is a completely server based program and I doubt whether installing a client emulation will solve my problem.
Hi Yogeeraj,

I have downloaded the xvfbinit.tar.gz file and installed the same. The daemon is running now in :10; I have set the export Display: IP:10 also.. Still the problem persists.. Any help will be highly appreciated..

Is there a way, i can check whether my configuration of hpux machine is fine for graphics support?

Thx,
Paramesh
Benedict
Occasional Advisor

Re: java graphics poblem

Hi,
I downloaded xvbf according to your advice in my HP-UX box and installed it successfully according to the installation document and I had set the export DISPLAY=(ip):10.0.and I could able to see the graphics in my java servlet program.
It worked fine once and I had put the DISPLAY variable in the start-up and also in .profile, after that it fails to work.
Any help....????

Params