Glassfish 4.1 won’t start in Yosemite 10.10.3 java
After upgrading to Yosemite 10.10.3, it appears that Glassfish will no longer start using the following command: bash
bin/asadmin start-domain domain1 JVM failed to start: com.sun.enterprise.admin.launcher.GFLauncherException: The server exited prematurely with exit code 0. Before it died, it produced the following output:
Command start-domain failed.
That’s slightly uncool. Not even an error message? app
It turns out that the Glassfish team made an assumption that they could uselaunchctl bsexec in theirnucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java file. dom
This sub-command now requires root privileges. ide
Someone has submitted a patch to Glassfish trunk, but if you want to continue using Glassfish immediately, you can create this script somewhere e.g. ~/bin/launchctl. ui
#!/bin/bash # A little hack to wrap launchctl in order to # successfully start Glassfish on Yosemite 10.10.3+ if [[ ${1} == "bsexec" ]]; then nohup ${@:3} else /bin/launchctl ${@} fi
Remember to ‘chmod 755 ~/bin/launchctl’ so that it is executable. this
Also remember that your ~/.profile or ~/.bash_profile must have something like this: idea
export PATH="$HOME/bin:$PATH"
The idea here is that this script is a wrapper for launchctl. As a user in Yosemite 10.10.3, you cannot run bsexec, but you may want to use launchctl for other things. spa