aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Getting segmentation fault 11 running Java GUIs on Unix via XWin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting segmentation fault 11 running Java GUIs on Unix via XWin" Watch "Getting segmentation fault 11 running Java GUIs on Unix via XWin" New topic
Author

Getting segmentation fault 11 running Java GUIs on Unix via XWin

Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Hi,

I am not sure that this is the best forum for this topic, but looking through the various forums it appeared to be about the best one.

I have programmed Java GUIs for years, but have not deployed them in Unix for a long time. I am using XWin in combination with either/both PuTTY or SSH Secure Shell.

I am getting the captioned failure message via XWin when I run either AWT or Swing based GUIs in the manner mentioned. No problems running on Windows XP or 7.

I can bring up the applications (executable jarfiles) and they basically work once. Key tabbing between components does not work at all in any application.

In a Swing application the mere starting of the application triggers the fault code. Key functionality at this point is nonfunctional, but using the mouse works fine in the application.

In AWT applications, clicking a button that triggers a process in a background Thread is what usually causes the fault. However the processing completes correctly. When trying to execute the application a second time, however, the application will start, but at this point key functionality is nonfunctional and the processing won't be activated by a button press either.

These problems occur whether I SFTP the jarfile over to Unix or SFTP the java source files to Unix and then recompile and rejar the application within Unix.

I did post this problem @stackoverflow, but after a couple days I have not gotten much feedback. Any help would be appreciated.


~Bill
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

A segmentation fault is (usually) similar to a NullPointerException, but then in native code. This could be part of a third party library, or even the JVM itself.
Does your application work directly on the Unix machine, without using XWin and PuTTy / SSH Secure Shell? In other words, are you able to sit behind the Unix machine itself and try there?

Bill Johnston wrote:I did post this problem @stackoverflow, but after a couple days I have not gotten much feedback.

Thanks for being forthright, but could you also post a link? Otherwise we would need to search for the thread to see if we're not posting duplicate feedback.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Hi Rob,

I could post the link, but there is no feedback for you to view so there is no point. No answers are listed in other words. Someone did suggest debugging the XWin server, using the information contained in this link:

http://x.cygwin.com/devel/backtrace.html

But it proved to involved to do this so I dropped it; and for some reason his postings were deleted - not by me.

As to executing the Java application on Unix the answer is no. I have no GUI capabilities on the Unix box and that is why I am using XWin to run them from Unix.

What I really want to know is one of two things:

1. Has anyone else done this using this combination, run into a similar problem and found the solution?
-or-
2. Is anyone successfully do essentially what I want to do, but with another combination of software?

These applications all run fine on both Windows XP and version 7. This is really about experimentation - I want to see how the applications run from the Unix command line using an X11 server.

Thanks,
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

The last time I connected to a remote X11 server was somewhere in 2001, using a Linux machine with a local X11 installation as a client. I wasn't calling Java programs either.
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Thanks Rob,

Should I read into that, though, that this sort of thing is not a popular thing to do and basically I should just forget it?

If that's the case, I'm fine with that - after all, I want to spend my time on worthwhile projects not mule kicking ;)

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19762
    
  20

It just means that I never needed to do anything like this in a long time. Most UNIX / Linux servers I connected to didn't even have any windowing system, and I just used the command line through SSH.
Bill Johnston
Ranch Hand

Joined: Nov 17, 2005
Posts: 201
Okay, anyone else care to weigh in?
 
Don't get me started about those stupid light bulbs.
 
subject: Getting segmentation fault 11 running Java GUIs on Unix via XWin