You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by iksrazal <ik...@gmail.com> on 2005/12/22 14:30:15 UTC

remote tcpmon and HeadlessException

Hi all, 

I'm trying to run tcpmon remotely. I'm using X11 forwarding over ssh. X11 is 
working fine - I can type 'xclock' on the remote machine and it works. 

However, I get this error: 

/home/iksrazal/axis-1_3/lib> java -cp axis.jar -Djava.awt.headless=true  
org.apache.axis.utils.tcpmon 8090 localhost 9081
java.awt.HeadlessException
 at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
        at java.awt.Window.<init>(Window.java:274)
        at java.awt.Frame.<init>(Frame.java:401)
        at javax.swing.JFrame.<init>(JFrame.java:198)
        at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1814)
        at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1861)
        at org.apache.axis.utils.tcpmon.main(tcpmon.java:1900)

As you can see I've tried java.awt.headless=true . Any ideas? 

iksrazal

Re: remote tcpmon and HeadlessException

Posted by iksrazal <ik...@gmail.com>.
That was it!!! Thanks a bunch! 

iksrazal

Em Quinta 22 Dezembro 2005 13:57, o Jason Cwik escreveu:
> Don't use headless when forwarding over SSH.  You *do* have a head, it's
> just remote.
>
> On 12/22/05, Ron Reynolds <Ro...@ronreynolds.com> wrote:
> > from the JavaDocs
> > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/HeadlessException.html
> > it sounds like a headless system should have no display or UI components
> > whatsoever ("Thrown when code that is dependent on a keyboard, display,
> > or mouse is called in an environment that does not support a keyboard,
> > display,
> > or mouse").  i'm curious how tcpmon could possibly work without
> > display....
> > also i thought if something like 'xclock' works then you wouldn't have to
> > run
> > in headless mode... ??
> >
> > ................ron.
> >
> > > Hi all,
> > >
> > > I'm trying to run tcpmon remotely. I'm using X11 forwarding over ssh.
> >
> > X11 is
> >
> > > working fine - I can type 'xclock' on the remote machine and it works.
> > >
> > > However, I get this error:
> > >
> > > /home/iksrazal/axis-1_3/lib> java -cp axis.jar -Djava.awt.headless=true
> > > org.apache.axis.utils.tcpmon 8090 localhost 9081
> > > java.awt.HeadlessException
> > >  at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java
> > >
> > :121)
> > :
> > >         at java.awt.Window.<init>(Window.java:274)
> > >         at java.awt.Frame.<init>(Frame.java:401)
> > >         at javax.swing.JFrame.<init>(JFrame.java:198)
> > >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1814)
> > >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1861)
> > >         at org.apache.axis.utils.tcpmon.main(tcpmon.java:1900)
> > >
> > > As you can see I've tried java.awt.headless=true . Any ideas?
> > >
> > > iksrazal

Re: remote tcpmon and HeadlessException

Posted by Jason Cwik <bi...@gmail.com>.
Don't use headless when forwarding over SSH.  You *do* have a head, it's
just remote.

On 12/22/05, Ron Reynolds <Ro...@ronreynolds.com> wrote:
>
> from the JavaDocs
> http://java.sun.com/j2se/1.4.2/docs/api/java/awt/HeadlessException.html it
> sounds like a headless system should have no display or UI components
> whatsoever ("Thrown when code that is dependent on a keyboard, display, or
> mouse is called in an environment that does not support a keyboard,
> display,
> or mouse").  i'm curious how tcpmon could possibly work without
> display....
> also i thought if something like 'xclock' works then you wouldn't have to
> run
> in headless mode... ??
>
> ................ron.
>
> > Hi all,
> >
> > I'm trying to run tcpmon remotely. I'm using X11 forwarding over ssh.
> X11 is
> > working fine - I can type 'xclock' on the remote machine and it works.
> >
> > However, I get this error:
> >
> > /home/iksrazal/axis-1_3/lib> java -cp axis.jar -Djava.awt.headless=true
> > org.apache.axis.utils.tcpmon 8090 localhost 9081
> > java.awt.HeadlessException
> >  at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java
> :121)
> >         at java.awt.Window.<init>(Window.java:274)
> >         at java.awt.Frame.<init>(Frame.java:401)
> >         at javax.swing.JFrame.<init>(JFrame.java:198)
> >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1814)
> >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1861)
> >         at org.apache.axis.utils.tcpmon.main(tcpmon.java:1900)
> >
> > As you can see I've tried java.awt.headless=true . Any ideas?
> >
> > iksrazal
> >
>
>
>

Re: remote tcpmon and HeadlessException

Posted by Jason Cwik <bi...@gmail.com>.
- What error do you get when you *don't* use -Djava.awt.headless=true ?
- What is your DISPLAY environment variable set to?

If your DISPLAY variable isn't set, you might need to either use -X when
ssh'ing into the box, or modify your sshd_config and set X11Forwarding yes.
Some SSH servers don't allow X11 forwarding by default.


On 12/22/05, iksrazal <ik...@gmail.com> wrote:
>
> Just to address your curiosity - X11 is a protocol. Its completely capable
> of
> running a keyboard and a display remotely - much I suppose like Windows
> terminal server (never used it). xclock most certainly needs X11 -
> runlevel 3
> in front of the keyboard (locally) in any type of unix for example won't
> be
> able to run xclock. (Will give 'Error, can't open display' ) . Or with
> KDE/Gnome and the like you can type ctrl-alt-F1 and you'll get a shell
> with
> X11, which also can't run xclock. X11/ssh allows programs that need a GUI
> to
> be invoked remotely.
>
> A good example of running a java awt/swing program remotely is JMeter - as
> you
> don't want the program affecting performace testing. That works over
> X11/ssh
> just fine.
>
> With that out of the way, any help highly appreciated.
>
> iksrazal
>
> Em Quinta 22 Dezembro 2005 13:10, o Ron Reynolds escreveu:
> > from the JavaDocs
> > http://java.sun.com/j2se/1.4.2/docs/api/java/awt/HeadlessException.htmlit
> > sounds like a headless system should have no display or UI components
> > whatsoever ("Thrown when code that is dependent on a keyboard, display,
> or
> > mouse is called in an environment that does not support a keyboard,
> > display, or mouse").  i'm curious how tcpmon could possibly work without
> > display.... also i thought if something like 'xclock' works then you
> > wouldn't have to run in headless mode... ??
> >
> > ................ron.
> >
> > > Hi all,
> > >
> > > I'm trying to run tcpmon remotely. I'm using X11 forwarding over ssh.
> X11
> > > is working fine - I can type 'xclock' on the remote machine and it
> works.
> > >
> > > However, I get this error:
> > >
> > > /home/iksrazal/axis-1_3/lib> java -cp axis.jar -
> Djava.awt.headless=true
> > > org.apache.axis.utils.tcpmon 8090 localhost 9081
> > > java.awt.HeadlessException
> > >  at
> > > java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java
> :121)
> > > at java.awt.Window.<init>(Window.java:274)
> > >         at java.awt.Frame.<init>(Frame.java:401)
> > >         at javax.swing.JFrame.<init>(JFrame.java:198)
> > >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1814)
> > >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1861)
> > >         at org.apache.axis.utils.tcpmon.main(tcpmon.java:1900)
> > >
> > > As you can see I've tried java.awt.headless=true . Any ideas?
> > >
> > > iksrazal
>

Re: remote tcpmon and HeadlessException

Posted by iksrazal <ik...@gmail.com>.
Just to address your curiosity - X11 is a protocol. Its completely capable of 
running a keyboard and a display remotely - much I suppose like Windows 
terminal server (never used it). xclock most certainly needs X11 - runlevel 3 
in front of the keyboard (locally) in any type of unix for example won't be 
able to run xclock. (Will give 'Error, can't open display' ) . Or with 
KDE/Gnome and the like you can type ctrl-alt-F1 and you'll get a shell with 
X11, which also can't run xclock. X11/ssh allows programs that need a GUI to 
be invoked remotely. 

A good example of running a java awt/swing program remotely is JMeter - as you 
don't want the program affecting performace testing. That works over X11/ssh 
just fine. 

With that out of the way, any help highly appreciated. 

iksrazal

Em Quinta 22 Dezembro 2005 13:10, o Ron Reynolds escreveu:
> from the JavaDocs
> http://java.sun.com/j2se/1.4.2/docs/api/java/awt/HeadlessException.html it
> sounds like a headless system should have no display or UI components
> whatsoever ("Thrown when code that is dependent on a keyboard, display, or
> mouse is called in an environment that does not support a keyboard,
> display, or mouse").  i'm curious how tcpmon could possibly work without
> display.... also i thought if something like 'xclock' works then you
> wouldn't have to run in headless mode... ??
>
> ................ron.
>
> > Hi all,
> >
> > I'm trying to run tcpmon remotely. I'm using X11 forwarding over ssh. X11
> > is working fine - I can type 'xclock' on the remote machine and it works.
> >
> > However, I get this error:
> >
> > /home/iksrazal/axis-1_3/lib> java -cp axis.jar -Djava.awt.headless=true
> > org.apache.axis.utils.tcpmon 8090 localhost 9081
> > java.awt.HeadlessException
> >  at
> > java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
> > at java.awt.Window.<init>(Window.java:274)
> >         at java.awt.Frame.<init>(Frame.java:401)
> >         at javax.swing.JFrame.<init>(JFrame.java:198)
> >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1814)
> >         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1861)
> >         at org.apache.axis.utils.tcpmon.main(tcpmon.java:1900)
> >
> > As you can see I've tried java.awt.headless=true . Any ideas?
> >
> > iksrazal

Re: remote tcpmon and HeadlessException

Posted by Ron Reynolds <Ro...@RonReynolds.com>.
from the JavaDocs
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/HeadlessException.html it
sounds like a headless system should have no display or UI components
whatsoever ("Thrown when code that is dependent on a keyboard, display, or
mouse is called in an environment that does not support a keyboard, display,
or mouse").  i'm curious how tcpmon could possibly work without display.... 
also i thought if something like 'xclock' works then you wouldn't have to run
in headless mode... ??

................ron.

> Hi all,
>
> I'm trying to run tcpmon remotely. I'm using X11 forwarding over ssh. X11 is
> working fine - I can type 'xclock' on the remote machine and it works.
>
> However, I get this error:
>
> /home/iksrazal/axis-1_3/lib> java -cp axis.jar -Djava.awt.headless=true
> org.apache.axis.utils.tcpmon 8090 localhost 9081
> java.awt.HeadlessException
>  at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121)
>         at java.awt.Window.<init>(Window.java:274)
>         at java.awt.Frame.<init>(Frame.java:401)
>         at javax.swing.JFrame.<init>(JFrame.java:198)
>         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1814)
>         at org.apache.axis.utils.tcpmon.<init>(tcpmon.java:1861)
>         at org.apache.axis.utils.tcpmon.main(tcpmon.java:1900)
>
> As you can see I've tried java.awt.headless=true . Any ideas?
>
> iksrazal
>