Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: permission error using Color class



Greg and Stephen,
Thank you for your quick help. It works if I run the application as follows;
java -Djava.awt.headless=true genGridNew
The link below was very helpful..
In case someone else has similar problem, I connect to mac using ssh from my Linux (redhat9) box. I set the display correctly (export DISPLAY=...0.0 using bash shell) and run xhost from my local box. I run some other graphical utilities so I am sure that the display was set up correctly. If I go to a different machine (windows box) and ssh to my linux box and run this application, it runs fine. I don't even have to play with the display settings. It is only a problem if I run it on mac.
I am not sure what "headles" session means in this context but I will keep reading the link below. For now it works with "-Djava.awt.headless=true".
thanks again
nihat


nc wrote:



kCGErrorRangeCheck : Window Server communications from outside of session
allowed for root and console user
only
Exception in thread "main" java.lang.InternalError: Can't connect to
window server - not enough permissions.
...
My application (genGridNew.java) has this entry on line 47:
Color colorsReq = new Color(red, grn, blu);
Could anyone give me a hint on this? I really don't know what to do here.
The same program runs on a Linux
platform. I tried display settings ( I am not using mac console, I am
running this trough an ssh session).



Please explain exactly what you mean by: 1. "I tried display settings" 2. "mac console"

I can think of several meanings for "display settings", but none of them
have a bearing on an SSH session, AFAIK.

I can also think of several interpretations of "mac console", including the
Terminal app, a remote login, etc.  And if SSH is involved, there are
several ways of using that, too.  Exactly how are you running the SSH
session?

And when you say it runs on a Linux platform, are you using SSH there, too?

Off the top of my head, have you tried running the SSH'ed java process as
headless?  I suspect that might make a difference, since SSH implies to me
that you are indeed running headless (i.e. without a graphics display in
the context of the process).  For info on headless mode see:
 <http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html#headless>

The critical property is:
 -Djava.awt.headless=true

 -- GG


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: permission error using Color class (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.