Review request for MACOSX_PORT-774: NullPointerException in strange circumstances (with error message: 'CFMessagePort: bootstrap_register(): failed 1100...')

Mike Swingler swingler at apple.com
Tue Dec 20 11:46:46 PST 2011


On Dec 20, 2011, at 7:06 AM, Anthony Petrov wrote:

> Hello,
> 
> Please review a fix for http://java.net/jira/browse/MACOSX_PORT-774 at:
> 
> http://cr.openjdk.java.net/~anthony/x-5-forceHeadless.0/
> 
> With this change, if we detect we don't have access to the graphics server, the AWT headless mode is forced. Actually, this has already been done in java_props_md/java_props_macosx.c previously, however, the legacy code in awt_LoadLibrary.c prevented it from working correctly.
> 
> Please note: running tests over an SSH connection will force the headless mode regardless of the logged in user on the console of the server. This is because OSX reports that the sessionHasGraphicAccess is missing when running over SSH. Thus, all graphical tests and applications must be run on the local console only.

Looks fine to me.

Also keep in mind, that if a background Java process is started by a launchd agent (like cron and initd on other platforms), you have to specify that the job needs to be in the "Aqua" session. This should allow automation to run, and should allow testing where an SSH connection can kick something that launchd is watching.

You could even go as far as making a directory for launchd to watch which will start and then delete any shell script dropped in that directory, just to ensure it's started in the Aqua session. Just throwing the idea out there. Just make sure the location and ownership is all under the same user.

Regards,
Mike Swingler
Apple Inc.



More information about the macosx-port-dev mailing list