使用systemctl命令systemctl restart glassfish
,GF可以正常重启。
但是当我尝试通过Web portail重新启动时https://127.0.0.1:4848
=> server =>重启,无故失败。
Glassfish停止但从未重启。
我在 Fedora 20 java 1.6.0_45 x86_64 上使用 Glassfish 3.1.2.2 。 (我也尝试 GF 4.1 Centos 7 java 1.8.0_66 x86_64 ,结果相同)
这是我的glassfish.service
文件:
[Unit]
Description=GlassFish Server
[Service]
User=glassfish
ExecStart=/usr/share/glassfish3/glassfish/bin/asadmin start-domain
ExecStop=/usr/share/glassfish3/glassfish/bin/asadmin stop-domain
ExecReload=/usr/share/glassfish3/glassfish/bin/asadmin restart-domain
Type=forking
[Install]
WantedBy=multi-user.target
以下是服务状态systemctl status glassfish -l
:
glassfish.service - GlassFish Server
Loaded: loaded (/usr/lib/systemd/system/glassfish.service; enabled)
Active: failed (Result: exit-code) since Wed 2016-07-27 11:17:22 CEST; 52s ago
Process: 9366 ExecStop=/usr/share/glassfish3/glassfish/bin/asadmin stop-domain (code=exited, status=0/SUCCESS)
Process: 877 ExecStart=/usr/share/glassfish3/glassfish/bin/asadmin start-domain (code=exited, status=0/SUCCESS)
Main PID: 1420 (code=exited, status=10)
Jul 27 10:24:20 decoder asadmin[877]: Successfully started the domain : domain1
Jul 27 10:24:20 decoder asadmin[877]: domain Location: /usr/share/glassfish3/glassfish/domains/domain1
Jul 27 10:24:20 decoder asadmin[877]: Log File: /usr/share/glassfish3/glassfish/domains/domain1/logs/server.log
Jul 27 10:24:20 decoder asadmin[877]: Admin Port: 4848
Jul 27 10:24:20 decoder asadmin[877]: Command start-domain executed successfully.
Jul 27 10:24:20 decoder systemd[1]: Started GlassFish Server.
Jul 27 11:17:22 decoder systemd[1]: glassfish.service: main process exited, code=exited, status=10/n/a
Jul 27 11:17:22 decoder asadmin[9366]: CLI306 Warning - The server located at /usr/share/glassfish3/glassfish/domains/domain1 is not running.
Jul 27 11:17:22 decoder asadmin[9366]: Command stop-domain executed successfully.
Jul 27 11:17:22 decoder systemd[1]: Unit glassfish.service entered failed state.
这是GF server.log:
[#|2016-07-27T11:17:20.805+0200|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=23;_ThreadName=Thread-2;|Server restart initiated|#]
[#|2016-07-27T11:17:20.810+0200|WARNING|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=23;_ThreadName=Thread-2;|There should be only 1 primordial module but 0 primordial modules were found.|#]
Jul 27, 2016 11:17:21 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:PermSize=64m
-XX:MaxPermSize=192m
-XX:NewRatio=2
-Xmx512m
-client
-javaagent:/usr/share/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-Dfelix.fileinstall.disableConfigSave=false
-Djavax.net.ssl.keyStore=/usr/share/glassfish3/glassfish/domains/domain1/config/keystore.jks
-Djava.awt.headless=true
-Dfelix.fileinstall.poll=5000
-Djava.endorsed.dirs=/usr/share/glassfish3/glassfish/modules/endorsed:/usr/share/glassfish3/glassfish/lib/endorsed
-Dfelix.fileinstall.bundles.startTransient=true
-Djavax.net.ssl.trustStore=/usr/share/glassfish3/glassfish/domains/domain1/config/cacerts.jks
-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as
-DANTLR_USE_DIRECT_CLASS_LOADING=true
-Djava.security.auth.login.config=/usr/share/glassfish3/glassfish/domains/domain1/config/login.conf
-Dgosh.args=--nointeractive
-Dosgi.shell.telnet.maxconn=1
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Dfelix.fileinstall.dir=/usr/share/glassfish3/glassfish/modules/autostart/
-Dosgi.shell.telnet.port=6666
-Djava.security.policy=/usr/share/glassfish3/glassfish/domains/domain1/config/server.policy
-Dfelix.fileinstall.log.level=2
-Duser.timezone=Europe/Zurich
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory
-Dosgi.shell.telnet.ip=127.0.0.1
-Dcom.sun.aas.instanceRoot=/usr/share/glassfish3/glassfish/domains/domain1
-Dcom.sun.aas.installRoot=/usr/share/glassfish3/glassfish
-Djava.ext.dirs=/usr/java/jdk1.6.0_45/lib/ext:/usr/java/jdk1.6.0_45/jre/lib/ext:/usr/share/glassfish3/glassfish/domains/domain1/lib/ext
-Dfelix.fileinstall.bundles.new.start=true
Jul 27, 2016 11:17:22 AM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 3 msec.
我没有SELinux否认,这是唯一的痕迹:
type=SERVICE_STOP msg=audit(1467638602.044:1652): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg=' comm="glassfish" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
将selinux模式设置为permissive无效。我完全不知道出了什么问题......
我还在Centos 6上测试了GF 3.1.2.2并且它有效。也许它与systemctl有关(Fedora 20和Centos 7默认都使用systemctl)?
答案 0 :(得分:0)
我不得不在8080中保留默认管理端口并添加"端口转发"防火墙规则从80到8080然后Glassfish重启正常工作。
来自https://serverfault.com/a/112798/393296和FirewallD规则是(对于Centos7)
注意:请务必将您的区域更改为活动区域(在这种情况下,我的活动区域为dmz - more info about FirewallD Centos7)
答案 1 :(得分:0)
需要添加到[服务] func safariViewController(_ controller: SFSafariViewController, didCompleteInitialLoad didLoadSuccessfully: Bool) {
Visualizer.start()
}