Solved

Running a JAVA Program on SOLARIS box getting a error -- Urgent help pls

Posted on 2003-11-14
135
2,376 Views
Last Modified: 2013-12-05
Hi all,

Would appreciate help pls..

I am trying to run some java application i got from other group on my SOLARIS box..they use to RUN this application on windows uptil now. Now we are porting it to SUN.

environment is

SUN 5.6
jdk 1.2.2

we run it as

java -DlogFileDir=/export/home/autotest/log ncss.run.BatchTest.MainTestServer

MainTestServer looks as below:

package ncss.run.BatchTest;

import javax.swing.UIManager;
import java.awt.*;
import javax.swing.*;
import java.net.InetAddress;

public class MainTestServer {
  boolean packFrame = false;

  /**Construct the application*/
  public MainTestServer(String sLogFileFullPath, String sHostIP, String sHostName) {
    TestServerFrame frame = new HarrisTestServerFrame();
    frame.setTitle(" Auto Test Agency @ " + sHostName + " " + sHostIP);
    TestLog log = new TestLog(frame.getLogListModel(),sLogFileFullPath);
    frame.setLog(log);
    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout
    if (packFrame) {
      frame.pack();
    }
    else {
      frame.validate();
    }
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = frame.getSize();
    if (frameSize.height > screenSize.height) {
      frameSize.height = screenSize.height;
    }
    if (frameSize.width > screenSize.width) {
      frameSize.width = screenSize.width;
    }
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.setVisible(true);
  }
  /**Main method*/
  public static void main(String[] args) {
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(Exception e) {
      e.printStackTrace();
    }

    InetAddress addr = null;
    try{ addr = InetAddress.getLocalHost(); }
    catch(Exception e){
      System.out.println("Can not get IP Address for the local host");
      e.printStackTrace();
      System.exit(1);
    }

    System.out.println("Local Host Name:    " + addr.getHostName());
    System.out.println("Local Host Address: " + addr.getHostAddress());
    System.out.println("Log subdirectory:   " + System.getProperty("logFileDir"));

    String sLogFullPath = null;
    if(args != null && args.length > 1)
      sLogFullPath = args[0];
    new MainTestServer(sLogFullPath, addr.getHostAddress(), addr.getHostName());
  }
}

I am getting error as below:

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 <Unloaded Method>
        at java.lang.Class.forName0(Native Method)


anything i am missing before i run my code?

do i need to set up some DISPLAY in env. variable or something?

right now

echo $DISPLAY

returns nothing.

help would be appreciated..

regards
0
Comment
Question by:shivani
  • 50
  • 34
  • 23
  • +3
135 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748331
Are you actually running X for other things or are you  in a console environment?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748347
Good point...
0
 

Author Comment

by:shivani
ID: 9748354
I am in CONSOLE environement.

don't know what is X.. sorryy..
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748364
The DISPLAY value should be automatically set up by the X server when it is executed...

without it, X just doesn't work right...although I think it does default to the local screen...

try "startx" on the solaris box  then, run your java
0
 

Author Comment

by:shivani
ID: 9748366
i am just reading about X11 and xhost and all that stuff. could not really understand.. never used it before
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748371
at the prompt, type:

startx

that should start the windowing environment :-)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748374
That is, assuming the box you are using has a monitor, and is not running as a headless server...
0
 

Author Comment

by:shivani
ID: 9748381
where is startx program..

it is not in path.. says startx not found..

could not find this program on my server..

only thing i have is xhost
in /usr/openwin/bin
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748386
You're using gui components without a gui probably. Either install X11 windowing or alternatively, you can use a Pure
Java AWT implementation such as the one at http://www.eteks.com/pja/en/
0
 

Author Comment

by:shivani
ID: 9748391
box does have a monitor..

though i am in telnet session right now.. box is not in front of me.. it is a remote box
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748430
> though i am in telnet session right now..

This will be a complete pain...

Trying to run any application on the Solaris box that has a GUI will require:

1) An X Server for your machine that you are using
2) An X Server running on the solaris box
3) Errr...I think that's it ;-)

Tim
0
 

Author Comment

by:shivani
ID: 9748432
CEHJ,

what do you mean

>> you can use a Pure  Java AWT implementation such as the one at http://www.eteks.com/pja/en/

I cannot rewrite the application right now..
I just have to start this application for now.. and modification/rewriting etc. will be for later..
This is a working app in windows.. i just need to somehow port it to solaris box..

X11 windowing? what is it ? where to get it? Is it free? is it something quick to install which i can do remote? since I am not at site today..

will it solve something?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748447
I take it you are on Windows?

There is a program called XWin32 http://www.starnet.com/products/

Which is an X Server for Windows...This will fullfill part (1), but you will need to set up X on the Solaris box too...and allow DISPLAYs to be farmed out across the network...

I am not sure how this is done, but I know it can be done...

Tim
0
 

Author Comment

by:shivani
ID: 9748456
what is XHOST?

what is X11 WINDOW?

what is XSERVER?

Why we have 3 terms here? sorry.. trying to understand as well
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748472
You might be able to connect to X over Telnet, but i'm not sure how. See this problem as 'how do I view a remote gui?' and work from that angle. X *is* a networked protocol so you should be able to do this
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748476
XHOST is a program that allows you to connect XSERVERS across from one machine to another

X11 WINDOW is a Window on the X11 system  ... basically, it's a window...

XSERVER is like "MS Windows" but for unix...  
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748483
>  You might be able to connect to X over Telnet, but i'm not sure how

See 1) and 2) above... ;-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748494
From what platform are you connecting to Solaris?
0
 

Author Comment

by:shivani
ID: 9748498
If we forget about Telnet for a second..

and if I am on solaris -- this box has a monitor..

what all do i need.. ?? to view on SOLARIS monitor..?

X SERVER on SOLARIS only??

what is XHOST in
/usr/openwin/bin
0
 

Author Comment

by:shivani
ID: 9748504
CEHJ,

windows..

Timyates.. you were right.. I am using win 2000
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748522
> what all do i need.. ?? to view on SOLARIS monitor..?

You need to run an X Windows server, such as OpenWindows, Gnome (I don't think it works on Solaris 5.6...thats a bit old), Motif, etc

> X SERVER on SOLARIS only??

Yes, if you are logging in from that machine

> what is XHOST

 XHOST is a program that allows you to connect XSERVERS across from one machine to another

From: http://www.csa.ru/~il/cgi-bin/man.cgi?topic=xhost

---------------

The  xhost  program  is used to add and delete host names or  user names to the list allowed to make connections to the  X server.
0
 

Author Comment

by:shivani
ID: 9748524
X11 WINDOW is a Window on the X11 system  ... basically, it's a window...

what is X11 system?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748532
Try typing

openwin

0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748546
at the command prompt

> what is X11 system?

X11 is version 11 of the X Windows system...  It's basically an API that most (all?) X Windows systems abide by...
0
 

Author Comment

by:shivani
ID: 9748563
$ pwd
/usr/openwin/bin
$ openwin
openwin: There is already a server running on :0
$
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748568
From http://www.x.org/X11.html

-------------------

The X Window System, more simply 'X' or 'X11', is judged worldwide to be one of the most successful open source, collaborative technologies developed to date. It is the de facto standard graphical engine for the UNIX* and Linux* operating systems and provides the only common windowing environment bridging the heterogeneous platforms in today's enterprise computing. The inherent independence of the X Window System from operating system and hardware, its network-transparency, and its support for a wide range of popular desktops are responsible for its continuing and growing popularity. All major hardware vendors support the X Window System. Many third parties provide technologies for integrating X Window System applications into network or personal computer environments under DOS, Windows, Windows 9x, and Windows NT, while thousands of independent software developers provide X Window System applications. The worldwide community of users of the X Window System currently exceeds 30 million.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748571
It looks as if this program may only be viewing a log file though - is it really worth all this effort ? ;-)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748583
> openwin: There is already a server running on :0

ooooh.....that's via telnet yeah?

From the actual Solaris machine, do you have X running?

ie:  do you have a mouse pointer, windows, menus, etc?

if so, try running the java app from a console window...see if it works

Tim
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748624
If that works, and you still want to run it on the solaris box, but from your windows box, you will need to go the route of XWin32 (or similar), like I said above...

This is the only way (I know of) to let a Solaris box open windows and stuff on a Windows box across the network...

Tim.
0
 

Author Comment

by:shivani
ID: 9748639
CEHJ,
there is something more in this program.. it actually runs some server as claimed from other group.. well, i didn't studied programm.. only goal right now is to somehow run this program..

TIM,

this actual SOLARIS machine has mouse, windows, menu etc.. yes.. !!!

and yes, from telnet, I am getting the mesg as
openwin: There is already a server running on :0


java app..  where??? on console?

didn' get you??

$ java app
Exception in thread "main" java.lang.NoClassDefFoundError: app

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748667
>>
from telnet, I am getting the mesg as
openwin: There is already a server running on :0
>>

You can't telnet to a machine and run 'startx', likewise you can't
telnet to a machine and type 'openwin'.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748684
> this actual SOLARIS machine has mouse, windows, menu etc.. yes.. !!!

Cool :-)

Log in on the actual Solaris machine (not via telnet) open a terminal (or a console -- depending on your XServer, it will be called different things -- it may even be called a "shell"), and try running your java application with the usual command line:

java -DlogFileDir=/export/home/autotest/log ncss.run.BatchTest.MainTestServer

The java program should run fine on that...

As I said, to run it via telnet is some more work, and involves an XServer on your windows machine (like XWin32)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748696
> openwin: There is already a server running on :0

This is because the Solaris machine is already running windows...

As CEHJ says, you cannot telnet to a machine and type startx or openwin, as it;

a) Is already running X (openwindows)
b) cannot display windows, menus, mouse, etc on your windows box via telnet
0
 

Author Comment

by:shivani
ID: 9748717
well, I will download XWIN32 then.. so it is like XSERVER right??

But i see it is only evaluation version for 30 days..

is there something I can use which is free? or doesn't expire
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748728
Yes, i'd give XWin32 a shot.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748765
This looks a *possibility*

http://sourceforge.net/projects/ibsxnet/
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748785
Does it work when you run it from being logged in on the solaris box?

> is there something I can use which is free?

There is this:

http://www.cygwin.com/xfree/

But I've never tried it...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748790
>  This looks a *possibility*

 Development Status: 1 - Planning, 2 - Pre-Alpha

;-)
0
 

Author Comment

by:shivani
ID: 9748791
well, XWIN32 doesn't seems to work on VPN..

I am connecting to my network via VPN


any ideas?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9748806
> I am connecting to my network via VPN

eeeek....it just gets worse!! ;-)

Try the cygwin one...it might work...but you are off in uncharted territory as far as my knowlege goes :-/

Good luck!!

Tim.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748818
Using Cygwin is another approach - link posted above by Tim. This effectively allows you to run Unix on your Windows box. You'll then have a more symmetrical environment.
0
 

Author Comment

by:shivani
ID: 9748906
Well, i am downloading cygwin right now..

let you know how it goes..

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748907
VNC - take a look at this:

http://www.realvnc.com/what.html
0
 
LVL 35

Accepted Solution

by:
TimYates earned 75 total points
ID: 9748941
*shudder* ;-)

I'd try cygwin first :-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9748962
I think, if there's a vnc server running on the Solaris box, all you need to do is connect with a vnc viewer (see above)
0
 

Author Comment

by:shivani
ID: 9749196
I downloaded CYGWIN..

well, don't know is there is something wrong with download i did.. or don't know what happened..

but all i get is an icon for CYGWIN bash shell..

according to instructions it says
Cygwin/X comes with a file called startxwin.bat that launches an X Server, a terminal, and a window manager.


but i could not find this


 startxwin.bat  anywhere..

how to know if VNC server is running on SOLARIS BOX ANYWAY?

In the meantime, I am again downloading CYGWIN..

if you have any idea on this, let me know pls
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9749235
>  I am again downloading CYGWIN..

Make sure you select that you want the X stuff...the installer gives you a list of stuff to download...

Or just get it all...

> how to know if VNC server is running on SOLARIS BOX ANYWAY?

It won't be (more than likely)...  Ask whoever set up the solaris box is the first port of call, or type:

ps aux | grep vnc

on the Solaris Box....it will probably give you no response...meaning that it isn't running...

Tim
0
 

Author Comment

by:shivani
ID: 9749548
This time i got the startxwindow file..

when i started it..

it displays error saying

could not find xterm anywhere...


any ideas? whats happening on this software?

VNC is not running.. u r right..

ps -ef | grep vnc doesn't return anything
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9749714
Is that Solaris box on the VPN?
0
 

Author Comment

by:shivani
ID: 9749720
when i try to do:

C:\cygwin\usr\X11R6\bin>XWin.exe -screen 0 800 600 -fullscreen -depth 32 -refr
h 85 -emulate3buttons 100 -nowinkill -unixkill
Program too big to fit in memory

C:\cygwin\usr\X11R6\bin>

any ideas?
0
 

Author Comment

by:shivani
ID: 9749725
no CEHJ,

it is just on network. i don't know about VPN.. but probably it is not
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9749780
Maybe you can get them to run vncserver on that box?

http://www.realvnc.com/man/vncserver.html
0
 

Author Comment

by:shivani
ID: 9749828
well,

I have been handed this box for testing. So I have to run/install everything whatever is needed on that box. But box is remote right now. So cannot do much with it. I have to do all the stuff via telnet only for today. I needed to get this running today.. but seems i am stuck
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9750145
Have you got root access?
0
 

Author Comment

by:shivani
ID: 9750448
yes
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9750527
Is X actually running on that box? Do

ps -aux | grep X
0
 

Author Comment

by:shivani
ID: 9750623
[ctsoper@technms45] $ ps -ef | grep X
ld.so.1: ps: warning: /usr/lib/0@0.so.1: open failed: illegal insecure pathname
 ttioper  6855   311  0 11:49:34 ?        0:05 /usr/openwin/bin/Xsun :0 -nobanner -auth /var/dt/A:0-z0a4Ma
    root   312     1  0   Nov 12 ?        0:00 /usr/lib/dmi/snmpXdmid -s technms45
 ttioper  6880  6856  0 11:49:48 ?        0:00 /bin/ksh /usr/dt/bin/Xsession
 ctsoper  5249  5021  0 16:40:53 ?        0:14 EXMgr
 ctsoper  5248  5021  0 16:40:53 ?        0:00 ComMgr -telnet CX100_SYOS:2007 -termsrv 4 -poll 100000 -rcvdelay 200000
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9750660
Hmm. Looks like you might have, but I'm out of my depth now. Suggest you go over to http://www.experts-exchange.com/Operating_Systems/Unix/
and maybe I can help later with the Java bit. Please post the Unix TA link here, though - i'm interested in this.
0
 

Author Comment

by:shivani
ID: 9750668
For using CYGWIN remotely,

what should be running on the remote SOLARIS server?
0
 

Author Comment

by:shivani
ID: 9750710
Well,

CEHJ,

I did a fresh install of CYGWIN on my different laptop.. looks little better..

I think I am able to get into the SOLARIS box.. (i think -- not sure..)
It displays a whole screen .. but DISPLAY is not clear.. it is like a blank screen with filled checks or something.. i cannot see anything on this screen.

Can you help?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9750750
>>
For using CYGWIN remotely,
what should be running on the remote SOLARIS server?
>>
     
Nothing AFAIK, apart from networking processes. Obviously if you want to be seeing windows, X should be running though.

Seriously though, I would definitely get over to Unix, maybe Linux too.
0
 

Author Comment

by:shivani
ID: 9750790
well, i asked question in X-WINDOWS TA..

Hope I get some reply soon..

but i think i am already on seeing SOLARIS box on my windows .. my mouse pointer on that window is different than windows mouse pointer.. just don't know how to adjust display to see the actual screen..

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9751019
Sounds like you're making progress. Can you post the link?
0
 

Author Comment

by:shivani
ID: 9751020
0
 
LVL 92

Expert Comment

by:objects
ID: 9751487
you need to tell your Java app what display you want your app to appear on. (no need for vnc)
If it's the Solaris box then specify the display name of the Solaris screen you want to use.
If it's the Windows box then run your X server s/w on it and specify the display name of the windows screen.
0
 
LVL 92

Expert Comment

by:objects
ID: 9751517
Or you can simply set the display name to use in the environment, something like:

export DISPLAY=hostname:0.0
0
 

Author Comment

by:shivani
ID: 9751548
running x-server s/w is what is causing problem objects..

i am on win2k on "VPN". and program is on solaris box.

what x-server do i need for windows? i tried x-win32. it doesn't work on VPN i guess.. atleast I could not make it work..

I tried crygin - xfree..  i finally got somehow to solaris-tile screen .. but doesnt see the actual CDE login screen
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:shivani
ID: 9751565
when tried to run X-WIN32, it errors

XDMCP:SESSION FAILED: SESSION 16 FAILED FOR DISLAY <1P>:0 CANNOT OPEN DISPLAY
0
 
LVL 92

Expert Comment

by:objects
ID: 9751657
How do you have it configured?

If you are starting it from your telnet window then you probably don't even need to login, though you may find it easier than having a seperate telnet window.
0
 
LVL 92

Expert Comment

by:objects
ID: 9751682
> FOR DISLAY <1P>:0

That doesn't look right.
WHats the windows host name?
0
 
LVL 5

Expert Comment

by:willy134
ID: 9751689
telnet (or ssh preferably) to the solaris machine and type

who -T

this will tell you what you are connecting to the box from.

Now make sure one of the xservers are running.  It shouldn't matter wich

At the prompt terminal type
echo $SHELL

if the shell has sh csh or tcsh in in type this

setenv DISPLAY <the machine who-T said you were connecting from>:0

where <the machine who-T said you were connecting from>
is replaced by the what it says to replace it with.

if it say bash or ksh the command is
export DISPLAY=<...>:0

same as above but with export and the equals sign (my bet is you are using csh)

now test out the X display by typing
xterm &


Let me know how that goes.
0
 
LVL 92

Expert Comment

by:objects
ID: 9751722
The problem is getting the X server running on the windows box, not specifying what display to use (that's already been mentioned).
Any experience setting up X-Win32?
0
 
LVL 5

Assisted Solution

by:willy134
willy134 earned 75 total points
ID: 9751760
I wouldn't run the XDMCP that requires the remote computer to have it enabled.  It has been about 3 years since I played with X-Win32.  Can you just get the xserver to run?  That is why it might be easier to just use cygwin xfree and then reroute the display to the windows box.  You shouldn't need to open a whole new xsession on the remote computer using XDMCP
0
 
LVL 5

Expert Comment

by:willy134
ID: 9751776
BTW how goes the vnc?
0
 
LVL 92

Expert Comment

by:objects
ID: 9751792
> That is why it might be easier to just use cygwin xfree and then reroute the
> display to the windows box.

Thats what I thought :)

0
 

Author Comment

by:shivani
ID: 9751852
Well,

SOrry but I am really confused now..

Please help me slowly if you could ..


Again,

I am trying to run get access to SOLARIS box remotely ..

I am on WIN2K .. and I am on VPN..

Now, seems like uptil now from the conversations, I have X-SERVER running on SOLARIS..

I have XFREE86 (CYGWIN) as well as XWIN32 on my win 2k...

Now please can you tell me again, what is to be done..??

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9751876
Just to put my oar in once again, I was thinking that the somewhat greater symmetricality of vncserver/vncviewer over cygwin/X might make things easier to configure
0
 
LVL 92

Expert Comment

by:objects
ID: 9751890
All I think you need to do is get an X server running on your windows box, and give your solaris box access to the display.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 9751928
> I am trying to run get access to SOLARIS box remotely ..

You already have remote access (via telnet), what you need to redirect the display of your Java app on Solaris to your Windows box which requires that it is running an X server.

> I have XFREE86 (CYGWIN) as well as XWIN32 on my win 2k...

You need to get one of these running.
No login or anything else required.
0
 

Author Comment

by:shivani
ID: 9753828
OBJECTS,

I understand I already have access to SOLARIS box. I meant.. I am trying to get remote access to the BOX to actually see it not via telnet session but via X -- OR Emulation kind of thing.. (sorry if i am using wrong terms here.. but this is the first time I am dealing with X-WINDOWS) and this is very new to me.. so I am getting confused.. But just learning from all the guidelines i am getting at expert-exchange.

I understand I need one of XFREE86 or XWIN32.

I would prefer XFREE86, because it is not evaluation software.. it is free s/w. and so will never expire.. X-WIN32 is evaluation version.

CEHJ, i am still not experimented with VNC yet, but i downloaed VNC Viewer and VNC Server..

I put VNCSERVER on my SOLARIS BOX.. But then i realised that it needs PERL.. (one more problem).. since I don't have PERL on solaris box.. so i still have download PERL ..

But all,

As mentioned in my previous comments,

When I am using XFREE86, I am able to establish a SOLARIS session..
Thing is, I am just seeing SOLaris tiles, and mouse pointer.. cannot see the login screen etc.

Isn't this just a display problem? If we forget about java app for a second, and concentrate on "GETTING SOLARIS DISPLAY on windows".. seems like just a display problem.. but don't know how to fix it..

Also, probably (I think.. not sure), If i am directly on network (and not via VPN), it might work fine also..
But i have to work via VPN somehow.. (this is a goal)
0
 

Author Comment

by:shivani
ID: 9753847
CEHJ,

don't u think VNC SERVER will have same problem.. since
with XFREE86, I am able to see SOLARIS TILE on my windows PC..

VNC -- will not it have same DISPLAY Problem..


BTW,

This is how i am using XFREE86.. (just in case I am missing something..)
C:\cygwin\usr\X11R6\bin
i click on startxwin.bat..

it opens up bash window..


i type..

XWin.exe -query <ip-address>

it opens up that tile screen
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9753855
>>I put VNCSERVER on my SOLARIS BOX

OK. I'd would try one thing at a time. Forget that for now. It's not as attractive anyway if it has Perl (or any) dependencies. I was imagining two executables, one each end.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9754181
>>
i type..

XWin.exe -query <ip-address>

it opens up that tile screen
>>

Try:

XWin.exe -query solaris_hostname_or_ip_address -fp tcp/solaris_hostname_or_ip_address:7100
0
 

Author Comment

by:shivani
ID: 9754326
cehj,

well.. i didn't see your comment before and I went with VNC....

finally i am able to get VNC Working..

VNC SERVER is running on SOLARIS server..

i got VNC Viewer on w2k..

I clicked on VNC Viewer on WIN2K..

it asked me hostname and display..

so i gave hostname:display

it asked for password..
i gave passwd..

it display solaris box on my machine.. but again with blank screen..

I can see SOLARIS on my WIN2K.. with SOLARIS Mouse Pointer ..but blank screen..

>>Try:

XWin.exe -query solaris_hostname_or_ip_address -fp tcp/solaris_hostname_or_ip_address:7100


You are talking about font-server right?

Well!! I tried it.. Got the same Tile Screen again..

I don't think FONT-SERVER in running on my SOLARIS box..
How to check or how to run etc.. i have no idea..




0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9754381
Well, maybe my initial instincts were right afer all ;-) STILL - you should not mix n' match. Decide to go with one or the other or you could get into terrible problems.

btw, is the Solaris box meant to be running with a desktop?
0
 

Author Comment

by:shivani
ID: 9754456
Ok Lets go with VNC for now.. ? what do you say? I am okay with any.. but lets go with VNC if it is okay ..


What do you mean when u say :

>>btw, is the Solaris box meant to be running with a desktop?

I cud not really understand this Q..

But:

Solaris box has monitor and mouse and all.. and if we walk to SOLARIS box, we can see the monitor and everything looks okay on the monitor.. I have see this BOX before ..

Moreover, I have see it working with one other X-SERVER software on windows .. (not at VPN though -- but if for example, my WIN2K pc was at network without VPN, and I had X-SERVER on my WIN2K platform, I could see the the SOLARIS screen on WIN2K box)..  That X-SERVER is not being used any more.. so forget about it..


Now I am trying to use VNC .. it gives me access.. but with blank screen...

If I telnet in SOLARIS BOX and see the VNC LOG.. I see the details of session from my WIN2K.. so ofcourse my WIN2K is connected.. Just that it doesn't display it..


0
 

Author Comment

by:shivani
ID: 9754470
oh by the way, i don't know it is important for you or not.. but just FYI, i am using CISCO VPN..
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9754521
>>I cud not really understand this Q..

Well, it's possible that there are no windows over there - it *can* run in console mode ;-)
But take a look at this:

http://lists.suse.com/archive/suse-linux-e/2002-Aug/2489.html
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9754539
Obviously that's Linux, but similar principles should apply. What's in *your* xstartup file?
0
 

Author Comment

by:shivani
ID: 9754659
# vi /export/home/nmsadm/.vnc/xstartup

"/export/home/nmsadm/.vnc/xstartup" 6 lines, 152 characters


#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
0
 

Author Comment

by:shivani
ID: 9754684
from log:

15/11/03 12:38:15 Got connection from client 192.168.200.43
15/11/03 12:38:15 Protocol version 3.3
15/11/03 12:38:18 Pixel format for client 192.168.200.43:
15/11/03 12:38:18   8 bpp, depth 8
15/11/03 12:38:18   true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
15/11/03 12:38:18 Using ZRLE encoding for client 192.168.200.43
15/11/03 12:38:18 Pixel format for client 192.168.200.43:
15/11/03 12:38:18   16 bpp, depth 16, little endian
15/11/03 12:38:18   true colour: max r 31 g 63 b 31, shift r 11 g 5 b 0
15/11/03 12:38:18 Using ZRLE encoding for client 192.168.200.43
0
 

Author Comment

by:shivani
ID: 9754776
I actually get this grey screen...


whats going on
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 250 total points
ID: 9755131
#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &


Try replacing that

>>twm &

with

dtwm &

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9755442
0
 
LVL 5

Expert Comment

by:willy134
ID: 9756303
you have to make sure those window managers are in the path that you can acces.  If you type in xterm at the prompt or twm or dtwm what does it say?

It should say cannot open display or something like that.

Also you may want to try the whole path in the xstartup file
so instead of
xterm......
do
/usr/bin/xterm
or wherever the executable is located
this can be found by typing which xterm at any prompt
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9756334
They should generally be in the path surely? (Although it may be wiser to assume otherwise)
0
 
LVL 92

Expert Comment

by:objects
ID: 9756548
> cannot see the login screen etc.

You don't need the login screen.
Once the xserver is running simply shange your DISPLAY variable in your telnet session to point to your Windows display and run your Java app.
0
 

Author Comment

by:shivani
ID: 9757665
CEHJ,

WELL,
I tried with dtwm &
and dtsession &

both has same results..

I changed my xstartup file..
did a ps -ef | grep vnc

kill -9 <pid>

./vncserver

same results -- grey screen .. with a application console window..


Willy,

# find / -name xterm
/usr/openwin/bin/xterm
/usr/share/lib/terminfo/x/xterm
#

# echo $PATH
/usr/sbin:/usr/bin:/usr/openwin/bin/:/usr/vnc
#

# xterm
xterm Xt error: Can't open display:
#


# twm
twm:  unable to open display ""
#

# dtwm
dtwm: not found
#


# dtsession
dtsession: not found
#




0
 

Author Comment

by:shivani
ID: 9757683
oh well, seems we are successful finally..

i needed to give the whole path

/usr/bin/dt/dtwm & in xstartup ..

and it seems to be working..


I can see my solaris system now..

but I tried to Logout of the SOLARIS system.. it throwed an error..
saying:

The request to service this action has failed for the following reason:

TT_ERR_NO_MATCH There is no running program to handle this message, nor is there a static ptype to start such a program. Check whether the application needs  (well after that window cannot be expanded.. so message is cut..)


Is it that some operations cannot be done on VNC or something????


0
 
LVL 92

Expert Comment

by:objects
ID: 9757808
Have you tried running your app? If X is running on the Windows box then you should be able to run it by changing the DISPLAY.
0
 
LVL 92

Expert Comment

by:objects
ID: 9757837
> When I am using XFREE86, I am able to establish a SOLARIS session..
> Thing is, I am just seeing SOLaris tiles, and mouse pointer.. cannot see the login
> screen etc.

Repeating you do not need the login screen.

> Isn't this just a display problem?

No it just means your not starting up the login program.

> If we forget about java app for a second, and
> concentrate on "GETTING SOLARIS DISPLAY on windows"..

Change the DISPLAY var in your telnet session, then any X app you start will display on your windows box. (No VNC required).
0
 
LVL 92

Expert Comment

by:objects
ID: 9757849
Pupose of VNC is to control a compters desktop remotely whereas what you want to do is actually have your Java app run on Solaris, but display its window on a seperate computer.
0
 
LVL 92

Expert Comment

by:objects
ID: 9757886
> This is how i am using XFREE86.. (just in case I am missing something..)
> C:\cygwin\usr\X11R6\bin
> i click on startxwin.bat..
> it opens up bash window..
> i type..
> XWin.exe -query <ip-address>

Why did you run XWin?  startxwin should have already started it.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9758166
>>
Pupose of VNC is to control a compters desktop remotely whereas what you want to do is actually have your Java app run on Solaris, but display its window on a seperate computer.
>>

This is important shivani - i was labouring under a misapprehension. If objects is right, and i'm willing to bet he is, then you need to change your tack, even if it *appears* you've made more progress with vnc.
0
 

Author Comment

by:shivani
ID: 9758805
Objects,


WHEN YOU SAID,

>> If X is running on the Windows box then you should be able to run it by changing the DISPLAY.

but "X" is not running on my windows BOX right?

Or do you mean.. "When I click on  XFREE86 startxwin .. is starts the "X" on my windows ..?

oKAY,

I click on startxwin.bat in windows -- it starts the "X" on my windows..

Now I open a telnet session on my solaris server -- and try to run JAVA APP right??

How should I Change the DISPLAY var in your telnet session.. to what value??


0
 

Author Comment

by:shivani
ID: 9758855
I tried doing this..

I clicked on startxwin to start "X" on windows (name of windows machine is say    kkk)..

It displays "X" icon next to clock..  (so I guess "X" is running.. right?)


I opened a telnet session with my solaris machine (name of solaris machine is say abc)


I did ..

DISPLAY=kkk:0.0
export DISPLAY

and then I did  on console on solaris as


java -DlogFileDir=/export/home/autotest ncss.run.MainTestServer ..

I got the same error..

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'kkk:0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at <Unloaded Method>
        at java.lang.Class.forName0(Native Method)


0
 

Author Comment

by:shivani
ID: 9758889
Ok well,

I tried with this..

My windows has IP ADDRESS say as
"115.2.11.1". (Please note.. I used actual IP Address of windows.. this is just an example.)

In telnet,  I did..

DISPLAY=115.2.11.1:0.0
export DISPLAY..

and then I started Java Program..

It seemed to be running fine this time..

Didn't throw any expection/error..for long time...(much longer than before..)

but finally came up with same kind of error
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using '115.2.11.1:0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at <Unloaded Method>
        at java.lang.Class.forName0(Native Method)

Well, I can see "X" still running with the "X" icon next to my clock..

and I think 0.0 is OKAY..

because in startxwin script..

I see

first line as

@echo off
SET DISPLAY=127.0.0.1:0.0

RIGHT?

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9758904
In what program are you telnetting?
0
 

Author Comment

by:shivani
ID: 9758921
BTW,

If I should be using the IP ADDRESS in DISPLAY..

Which IP ADDRESS should I be using..

One is the ip address of my WIN2K box..

(from ipconfig on cmd prompt) say example '115.2.11.1'

second is -- If I open up my CISCO VPN CONNECTION STATS..

I get Client IP ADDRESS as a different value.. say example  :  116.3.12.78

and one more is
Server IP ADDRESS on CISCO VPN CONNECTON STATS.. say example : 200.3.35.82

I tried with '115.2.11.1' with delayed error response
I tried with 116.3.12.78 with prompt error response.

in both i used 0.0 as the value

(115.2.11.1:0.0)


any ideas

0
 

Author Comment

by:shivani
ID: 9758925
CEHJ,

I am using CRT 3.4
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9758965
And that's X-enabled?
0
 

Author Comment

by:shivani
ID: 9759001
well, i don't know..

what telnet program is? I have no idea sorry..

0
 
LVL 92

Expert Comment

by:objects
ID: 9759735
> Which IP ADDRESS should I be using..

The IP of the windows box.

First test you can see that ip using ping.

ping <ip of windows box>
0
 
LVL 92

Expert Comment

by:objects
ID: 9759739
CEHJ> And that's X-enabled?

telnet doesn't need to know anything about X.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9760049
>>No, but the window in which it's showing is what i'm getting at, and that needs to be an X server does it not?
0
 
LVL 92

Expert Comment

by:objects
ID: 9760064
> and that needs to be an X server does it not?

Not at all. Why would you think that?

0
 

Author Comment

by:shivani
ID: 9760190
Objects ,

probably you wanted me to do a ping from SOLARIS box to windows right?

I tried this .. opened a telnet session in CRT .. from windows to solaris box..

in telnet session.. i tried..

/usr/sbin/ping <ip-address> of windows box..

reply from ping is

no answer from <ip-address-of-windows>

well, my windows box is not on same network .. i mean windows box is on network via VPN..

is this a problem?
0
 
LVL 92

Expert Comment

by:objects
ID: 9760203
> is this a problem?

Maybe. I'll see if I can find a workaround.
0
 
LVL 92

Expert Comment

by:objects
ID: 9760227
I think you need to setup a tunnel between the two boxes, though I have never done this. Perhaps ask on your open q in the X Windows topic if anyone has experience.
0
 
LVL 92

Expert Comment

by:objects
ID: 9760234
0
 

Author Comment

by:shivani
ID: 9761432
i could not really find much help from
http://openvpn.sourceforge.net/

Let me know if u have some solution..

I am using CISCO vpn though.. (JUST FYI)
I noticed in properties of CISCO VPN..

"enable transparent tunneling is checked.."

under this we have two radio buttons:

"ALLOW IPSec over UDP (NAT/PAT)"

"USE IPSec over TCP (NAT/PAT/FIREWALL)"


The first one ("ALLOW IPSec over UDP (NAT/PAT)") is picked among the above two.

Well, I tried with TCP also.. but I cannot connect from VPN with TCP choosen..

it only accepts for UDP..

Just wanted to give this information, may be it can be helpful to figure out something...

regards






0
 
LVL 92

Expert Comment

by:objects
ID: 9761600
Try asking in the Networking topic.
0
 

Author Comment

by:shivani
ID: 9764060
Well,
All,

Thanks alot for all your help and prompt replies..

I am so sorry to take this question so much off the track.. but sincerely, I have learnt so much from all this conversation..

I would say to forget about my this problem for now.. (if somebody knows the answe, just let me know...), I will out up another Q IN NETWORKING or make use of my open question in X-WINDOWS to takecare of my this problem of displaying GUI on windows box from SOLARIS machine.. once again thanks everybody for all the help and knowledge you guys have provided me with...

lets go back to original question..

now I have the SOLARIS BOX in my office.. so I will directly access the SOLARIS box and try to start the code there..

I am trying this right now..

This set of jar files is given to me from some other group (which no longer supports us), and so I have to deal with this alone..

(Please note that this program is running successfully on windows PC, I am just trying to port this to SOLARIS MACHINE)

According to instructions, I was told to set the classpath-- which I did..

I was told to run java program..

java -DlogFileDir=/export/home/autotest/log ncss.run.BatchTest.MainTestServer

So I did,

I get an error saying,

TestServer could not create Server Socket on port 1000
Test Server : No Server Socket..

So this program is trying to create socket on port 1000.

Porbably port 1000 is used somewhere else on my solaris box.. is it possible?? and thats why I get the error??

how can i check which ports are used on my solaris box? and what is port 1000 used for?

on my solaris box, there are several programs running, sybase db is running.. so it is possible that 1000 port is used somehwre else.. but how to find out ?? is it a possible cause?

I don't want to really change the code right now (though I have the src files..).. but that would be last resort, if nothing else works..

can u guys suggest something for above?

thanks

on console..
0
 

Author Comment

by:shivani
ID: 9764096
oh well,

in the src,

public class TesterServer extends Thread {
  private static TestLog log = null;
  private static final boolean DEBUG = false;

  public static final int EVENT_ID_SERVER_STOPPED = 1;

  private String sServerIP;
  private String sLogonID;
  private String sPassword;
  private Vector vecListener = new Vector();

  private ServerSocket serverSocket = null;
  private int port=1000;
  private boolean bKeepListening = true;

  public TesterServer(String sName, String sServerIP, String sLogon,
                            String sPassword, ActionListener listener, TestLog log) {
    super(sName);
    this.sServerIP = sServerIP;
    this.sLogonID = sLogon;
    this.sPassword = sPassword;
    if(listener != null)
      vecListener.addElement(listener);
    this.log = log;
  }


so

  private int port=1000;
 shows that it is hard-coded to use port 1000.

so probably this is a problem..

now question i think is, how to find out on my solaris box, what is port 1000 used for? and to free it possible.. so as to give port 1000 to this Server
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9764301
netstat -ep

might help...
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9764971
The problem could be with your network configuration, but you should change that hard-coding anyway, as it's not desirable:

    public TesterServer(String sName, String sServerIP, String sLogon,
                              String sPassword, ActionListener listener, TestLog log, int port) {
      this(sName, sServerIP, sLogon, sPassword, log);
      this.port = port;
    }
0
 

Author Comment

by:shivani
ID: 9765007
$ netstat -ep
usage: netstat [ -adgimnprsDMv ] [-I interface] [interval] [system] [core]
$
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9765111
> usage: netstat [ -adgimnprsDMv ] [-I interface] [interval] [system] [core]

Ahhh the joys of all UNIX flavours being different :-(

Sorry about that...

netstat should show you any app that runs on port 1000 tho...  just not sure what parameters you will need to pass..
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9765499
Do

man netstat
0
 
LVL 92

Expert Comment

by:objects
ID: 9766743
> TestServer could not create Server Socket on port 1000
> Test Server : No Server Socket..

Post the stack trace for the exception.
ex.printStackTrace();

To check if port 1000 is already being used just try and connect to it:

telnet 127.0.0.1 1000

0
 
LVL 3

Expert Comment

by:merphle
ID: 9771891
For whatever it's worth, Unix OS's won't let you create a server socket on ports less than (or equal?) 1024 unless you run the app as root.
0
 

Author Comment

by:shivani
ID: 9781676
All,

I actually finally the changed the code to port 2000. and it is working fine.

Moreover, I finally used VNC Viewer/server stuff to remotely start JAVA App.. and it seems to be working fine as well..

I know as objects explained VNC Viewer is actually not needed and there is a way to create a VPN funnel for GUI apps from SOLARIS to windows.. I could not figure out that solution uptil now..

but it is working fine right now.. with vnc viewer/server.. and port stuff..

so I would like to close this Q.. Many ppl. have helped me with all this stuff..

I really want to divide the points among you all specially..

objects (who helped me understaning X Windows)
CEHJ, who was big help to me again understanding X and my problem

TImYates who helped me identifying the problem..

would appreciate if you can help me with other Q's .. and tell me how to split points pls..

0
 
LVL 92

Expert Comment

by:objects
ID: 9781988
0
 
LVL 92

Expert Comment

by:objects
ID: 9782336
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9782349
8-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now