[jbosstools-dev] Special profile for java 1.7 on mac - how to do it

Max Rydahl Andersen max.andersen at redhat.com
Fri Nov 16 20:08:19 EST 2012


>> yeah - I'm curious about this - where did you find out sun.lwawt.macosx.LWCToolkit would solve it ? is this swtbot being weird ?
> 
> SWT bot is using awt under the hood for something - simulating keyboard pressing I think. Lucia found out about the fix so I don't know how. And she's on maternity leave, so she won't tell us :)

:)

>> note I google this and found we apparently have code that messes with this in our tests ?!
>> 
>> http://lists.jboss.org/pipermail/jbosstools-commits/2012-September/041589.html
>> 
>> so this is not a new issue?
> 
> Yes, it is not a new issue. But I didn't know about the hack in bot ext that is supposed to deal with this. And our dummy test where I was debugging this doesn't use bot ext (Jirka just submitted a pull request changing this test to use ReqAwareSuite from bot ext so that should fix it).

okey - so no need to change parent pom for now ?

>> What is the full stacktrace of that error about "headless environment" ?
> 
> Strangely enough when I tried this on my own MacBook the property was set correctly and the test ran fine. 
> For AppleJDK the property is: awt.toolkit=apple.awt.CToolkit
> For OracleJDK it is: awt.toolkit=sun.lwawt.macosx.LWCToolkit
> So there must be something wrong with the jenkins slaves that they set the property incorrectly for OracleJDK1.7 on Mac.

okey.

> But anyway, it seems for now we will try to solve this with the hack in bot ext (or fixing the slaves if we can determine how it happens).

cool.

> The exception when this happens is this:
> Error Message
> 
> java.awt.AWTException: headless environment
> Stacktrace
> 
> java.lang.RuntimeException: java.awt.AWTException: headless environment
> 	at org.eclipse.swtbot.swt.finder.keyboard.AWTKeyboardStrategy.<init>(AWTKeyboardStrategy.java:39)
> 	at org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory.getAWTKeyboard(KeyboardFactory.java:103)

weird it thinks you are in headless mode - any chance this is called "too soon" and AWT is not fully started yet ?

/max




More information about the jbosstools-dev mailing list