commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sam marshall (JIRA)" <>
Subject [jira] [Commented] (DAEMON-266) OS X 10.8: jsvc appears to cause hang on Toolkit.createDefaultToolkit
Date Thu, 08 Nov 2012 21:40:12 GMT


sam marshall commented on DAEMON-266:

Here's the stack trace:

"!!! Problem thread !!!!" prio=5 tid=7f9fba936000 nid=0x10b970000 runnable [10b96e000]
   java.lang.Thread.State: RUNNABLE
	at apple.awt.CToolkit.getContentScaleFactor(Native Method)
	at apple.awt.CToolkit.<init>(
	- locked <7aad423d8> (a java.lang.Object)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
	at java.lang.reflect.Constructor.newInstance(
	at java.lang.Class.newInstance0(
	at java.lang.Class.newInstance(
	at java.awt.Toolkit$
	at Method)
	at java.awt.Toolkit.getDefaultToolkit(
	- locked <6fb73d800> (a java.lang.Class for java.awt.Toolkit)
	at Test$

   Locked ownable synchronizers:
	- None

Note: I think this problem may be caused because it's using the wrong java-home. On Mac, the
correct java-home can be found by running /usr/libexec/java_home. Using this value, I tried
adding this argument to jsvc (this is the same one I used when building it):

-java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home

However I then get the error:

Cannot find any VM in Java Home /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
Cannot locate JVM library file
Service exit with a return value of 1

Without doing that, I modified the test script a bit to print out java.home:


I don't think that old Apple 1.6 JDK is really supposed to be used in the current OS X versions
(it's not even always installed and is only there to support 'legacy' bundled desktop .app
files), so this is probably the root of the problem; jsvc ought to be using the new Java 7
JDK, same that gets used if you type 'java -version' at the commandline. Just a guess though
- I'm not an expert in this.

Note: That also might mean that this problem can't be reproduced, or reproduces differently,
if you've never run a legacy Java app on the 10.8 Mac. (A legacy Java app is anything that
prompts the 'do you want to install java? this will take bloody ages' dialog from Apple.)
> OS X 10.8: jsvc appears to cause hang on Toolkit.createDefaultToolkit
> ---------------------------------------------------------------------
>                 Key: DAEMON-266
>                 URL:
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Jsvc
>    Affects Versions: 1.0.10
>         Environment: Max OS X 10.8.2
> (64-bit)
> $ java -version
> java version "1.7.0_09"
> Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
> Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
>            Reporter: sam marshall
>         Attachments: jsvc-bug.tar.gz
> When using jsvc to launch a service (such as Tomcat) on this platform, any use of the
Toolkit.createDefaultToolkit causes the current thread to hang indefinitely in native code.
> This does not happen when running the code directly using the normal 'java' runtime.
> I have a gz file containing all files necessary to reproduce this on my machine - will
add a comment and attach this file if it lets me, or figure out somewhere to put it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message