[ 
https://issues.apache.org/jira/browse/DAEMON-266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493517#comment-13493517
 ] 

sam marshall commented on DAEMON-266:
-------------------------------------

Here's the stack trace:

{code}
"!!! 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>(CToolkit.java:136)
        - locked <7aad423d8> (a java.lang.Object)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at java.awt.Toolkit$2.run(Toolkit.java:859)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:826)
        - locked <6fb73d800> (a java.lang.Class for java.awt.Toolkit)
        at Test$1.run(Test.java:22)

   Locked ownable synchronizers:
        - None
{code}

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):

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

However I then get the error:

{code}
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
{code}

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

{code}
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
{code}

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: https://issues.apache.org/jira/browse/DAEMON-266
>             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: http://www.atlassian.com/software/jira

Reply via email to