Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Can't connect to X11 window server using ':0.0'

Thread view: 
hrpreet - 26 Apr 2006 18:46 GMT
Hi All,
I'm trying to run a standalone application on solaris machine
,encountered the following problem.
How to go about it.

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.<clinit>(X11GraphicsEnvironment.java:1
34)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:141)
       at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
ronment.java:62)
       at sun.awt.motif.MToolkit.<clinit>(MToolkit.java:81)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:141)
       at java.awt.Toolkit$2.run(Toolkit.java:748)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:739)
       at java.awt.Toolkit.getEventQueue(Toolkit.java:1519)
       at java.awt.EventQueue.isDispatchThread(EventQueue.java:651)
       at
javax.swing.SwingUtilities.isEventDispatchThread(SwingUtilities.java:
1238)
       at javax.swing.text.StyleContext.reclaim(StyleContext.java:419)
       at
javax.swing.text.StyleContext.addAttribute(StyleContext.java:276)
       at
javax.swing.text.html.StyleSheet.addAttribute(StyleSheet.java:538)
       at
javax.swing.text.StyleContext$NamedStyle.addAttribute(StyleContext.ja
va:1468)
       at
javax.swing.text.StyleContext$NamedStyle.setName(StyleContext.java:12
78)
       at
javax.swing.text.StyleContext$NamedStyle.<init>(StyleContext.java:122
6)
       at javax.swing.text.StyleContext.addStyle(StyleContext.java:88)
       at javax.swing.text.StyleContext.<init>(StyleContext.java:68)
       at javax.swing.text.html.StyleSheet.<init>(StyleSheet.java:147)
       at
javax.swing.text.html.HTMLEditorKit.getStyleSheet(HTMLEditorKit.java:
355)
       at
javax.swing.text.html.HTMLEditorKit.createDefaultDocument(HTMLEditorK
it.java:186)
       at SolMetaTag.main(SolMetaTag.java:33)

Thanks
Gordon Beaton - 26 Apr 2006 19:19 GMT
> I'm trying to run a standalone application on solaris machine
> ,encountered the following problem. How to go about it.
>
> Exception in thread "main" java.lang.InternalError: Can't connect to
> X11 window server using ':0.0' as the value of the DISPLAY variable.

This really isn't a Java issue. The error message means that the
application tried to connect to the X server (i.e. the display), but
one of the following prevented it:

- you are not running an X server on your solaris box, but your
 DISPLAY variable ":0.0" is telling the application that you are.

- you are running an X server (maybe on another machine), but ":0.0"
 is not the correct DISPLAY value, so the application fails to
 connect to the server.

- there is an X server running and the DISPLAY variable is correct,
 however you are not authorized to connect to the server, either
 because it is owned by another user or because you have not
 configured your environment correctly.

If you don't think the program actually needs a GUI, you can specify
the following when you run the application:

 -Djava.awt.headless=true

See also:

 http://java.sun.com/j2se/1.5.0/docs/guide/awt/AWTChanges.html#headless

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

Morten Alver - 27 Apr 2006 10:42 GMT
>>I'm trying to run a standalone application on solaris machine
>>,encountered the following problem. How to go about it.
[quoted text clipped - 10 lines]
>   because it is owned by another user or because you have not
>   configured your environment correctly.

I've typically run into this (on Linux) when trying to run a graphical
application as root. Many Linux distros are by default set up to
disallow the root user from accessing the X server; perhaps the same is
true for Solaris.

--

Morten
Gordon Beaton - 27 Apr 2006 10:49 GMT
> I've typically run into this (on Linux) when trying to run a
> graphical application as root. Many Linux distros are by default set
> up to disallow the root user from accessing the X server; perhaps
> the same is true for Solaris.

Of course, because X authorization doesn't know who is trying to
connect (it's just a socket connection), so there's no way to give
special privileges to root.

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.