部署后Wildfly服务器自动关闭

时间:2019-03-24 06:26:19

标签: spring wildfly

我正在使用wildfly 14.0.1.Final服务器来部署Spring War应用程序。成功部署后经过一段时间,服务器通过提供以下日志自动停止;

    2019-03-24 11:27:31,002 INFO  [org.jboss.as.repository] (ServerService Thread Pool -- 99) WFLYDR0009: Content /opt/wildfly-14.0.1.Final/standalone/data/content/b6/e85bb4bda330a5b3febd424d21871177d573f1 is obsolete and will be removed
    2019-03-24 11:27:31,023 INFO  [org.jboss.as.repository] (ServerService Thread Pool -- 99) WFLYDR0002: Content removed from location /opt/wildfly-14.0.1.Final/standalone/data/content/b6/e85bb4bda330a5b3febd424d21871177d573f1/content
    2019-03-24 11:37:31,124 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0236: Suspending server with no timeout.
    2019-03-24 11:37:31,126 INFO  [org.jboss.as.ejb3] (Thread-2) WFLYEJB0493: EJB subsystem suspension complete
    2019-03-24 11:37:31,129 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested via an OS signal
    2019-03-24 11:37:31,173 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0019: Stopped Driver service with driver-name = UtilityMasterSatkhira.war_com.mysql.cj.jdbc.Driver_8_0
    2019-03-24 11:37:31,191 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
    2019-03-24 11:37:31,201 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 101) WFLYUT0022: Unregistered web context: '/UtilityMasterSatkhira' from server 'default-server'
    2019-03-24 11:37:31,217 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 101) Destroying Spring FrameworkServlet 'mvc-dispatcher'
    2019-03-24 11:37:31,217 INFO  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 101) Closing WebApplicationContext for namespace 'mvc-dispatcher-servlet': startup date [Sun Mar 24 11:17:53 BDT 2019]; parent: Root WebApplicationContext
    2019-03-24 11:37:31,229 INFO  [org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler] (ServerService Thread Pool -- 101) Shutting down ExecutorService 'base_scheduler'
    2019-03-24 11:37:31,245 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 101) Closing Spring root WebApplicationContext
    2019-03-24 11:37:31,245 INFO  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 101) Closing Root WebApplicationContext: startup date [Sun Mar 24 11:17:45 BDT 2019]; root of context hierarchy
    2019-03-24 11:37:31,259 INFO  [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] (ServerService Thread Pool -- 101) Closing JPA EntityManagerFactory for persistence unit 'default'
    2019-03-24 11:37:31,304 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0019: Host default-host stopping
    2019-03-24 11:37:31,307 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
    2019-03-24 11:37:31,310 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0019: Stopped Driver service with driver-name = h2
    2019-03-24 11:37:31,338 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0008: Undertow HTTP listener default suspending
    2019-03-24 11:37:31,338 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0008: Undertow HTTPS listener https suspending
    2019-03-24 11:37:31,344 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0007: Undertow HTTP listener default stopped, was bound to ip:80
    2019-03-24 11:37:31,344 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0007: Undertow HTTPS listener https stopped, was bound to ip:8443
    2019-03-24 11:37:31,348 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 108) WFLYCLINF0003: Stopped client-mappings cache from ejb container
    2019-03-24 11:37:31,366 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0004: Undertow 2.0.13.Final stopping
    2019-03-24 11:37:31,489 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment UtilityMasterSatkhira.war (runtime-name: UtilityMasterSatkhira.war) in 355ms
    2019-03-24 11:37:31,494 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0050: WildFly Full 14.0.1.Final (WildFly Core 6.0.2.Final) stopped in 361ms

自动关机的可能原因是什么?

Server Startup log

4 个答案:

答案 0 :(得分:0)

WFLYSRV0220: Server shutdown has been requested via an OS signal

告诉您从服务器收到关闭信号。另请参见https://developer.jboss.org/wiki/MysteriousShutdowns 建议您使用Java选项-Xrs来减少信号。

答案 1 :(得分:0)

我知道导致这种情况的一个原因是用户会话。

如果您不是以应用程序用户(不是 root 用户)身份运行 Wildfly,那么如果您注销或断开所有用户会话,操作系统将发送此关闭信号并关闭 Wildfly。

如果是这种情况,您需要为用户启用延迟,以便从所有用户会话中注销不会停止与该应用程序用户一起运行的进程。

要启用/禁用延迟,您可以参考 this link

答案 2 :(得分:0)

我在台式机上没有遇到过这样的问题,但是 mysql 容器以一种我在 ubuntu 笔记本电脑上无法理解的方式运行得很慢。因此,由于长时间运行的进程,操作系统发送了终止信号,keycloak 服务器不断出现错误。 This solution 拯救我的一天。

答案 3 :(得分:0)

就我而言,它发生在 RHEL 7.9(但我猜发行版无关紧要)安装中,我之前手动编辑了 /etc/hosts 文件以进行其他测试。 我的主机文件就像:

192.168.13.145   myservername
127.0.0.1   myservername
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

wildfly 管理控制台正在侦听“localhost”。 这以某种方式导致 Wilfly 在启动后几秒钟自动关闭。 通过将主机文件改回:

192.168.13.145   myservername
127.0.0.1   localhost
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

效果很好。