Yosemite不能启动glassfish4.1解决办法

2015/07/04 23:45
阅读数 200

Glassfish 4.1 won’t start in Yosemite 10.10.3

After upgrading to Yosemite 10.10.3, it appears that Glassfish will no longer start using the following command:

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?

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.

This sub-command now requires root privileges.

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.

#!/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.

Also remember that your ~/.profile or ~/.bash_profile must have something like this:

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.

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部