【问题标题】:Glassfish fails at start up ubuntu 12.04Glassfish 在启动 ubuntu 12.04 时失败
【发布时间】:2014-05-28 14:34:40
【问题描述】:

升级到最新版 ubuntu 12.04 后。我的 glassfish 启动脚本在启动时失败。

这是我的 boot.log 的相关部分:

Error starting domain XXXYYY.
The server exited prematurely with exit code 0.
Before it died, it produced the following output:
.....
adName=Grizzly-kernel-thread(1);|doSelect IOException
java.net.BindException: No free port within range: 8181=com.sun.enterprise.v3.services.impl.monitor.MonitorableSSLSelectorHandler@19e2595
......
[#|2014-05-28T09:08:28.639-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|Shutting down v3 due to startup exception : No free port within range: 80=com.sun.enterprise.v3.services.impl.monitor.MonitorableSelectorHandler@197e2a6|#]

但是,当我从控制台运行命令时 sudo service glassfish start 服务启动正常。

这是我的初始化脚本:

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

#!/bin/sh
#
# glassfish init script for Linux
# Simplest possible case -- no password file, one default domain
# it would be simple to add such options

GLASSFISH_HOME=${GLASSFISH_HOME:-"/home/glassfish"}

case "$1" in
start)
    $GLASSFISH_HOME/bin/asadmin start-domain XXXYYY >/dev/null
    ;;
stop)
    $GLASSFISH_HOME/bin/asadmin stop-domain XXXYYY >/dev/null
    ;;
restart)
    $GLASSFISH_HOME/bin/asadmin restart-domain XXXYYY >/dev/null
    ;;
\*)
    echo "usage: $0 (start|stop|restart|help)"
esac

我会感谢任何帮助

【问题讨论】:

  • 我认为您的Required-Start 行是错误的,并在网络启动之前触发了鱼的启动,这是它绝对不喜欢的。看看this script,他们使用# Required-Start: $local_fs $remote_fs $network $syslog $named
  • 谢谢。我做了更改并调整了你的脚本,但我得到了同样的错误:[#|2014-05-28T11:34:04.311-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise。 v3.server|_ThreadID=1;_ThreadName=main;|由于启动异常关闭 v3 : 范围内没有空闲端口: 8081=com.sun.enterprise.v3.services.impl.monitor.MonitorableSSLSelectorHandler@d6cffa|#]

标签: ubuntu amazon-ec2 ubuntu-12.04 glassfish-3


【解决方案1】:

最后我用 sudo update-rc.d -f glassfish remove 删除了启动服务,并将脚本的执行添加到 /etc/rc.local 文件中。

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0

/etc/init.d/glassfish start

【讨论】:

    猜你喜欢
    • 2014-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-26
    • 1970-01-01
    • 2014-04-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多