Jboss 服务器在指向另一个数据库服务器后无法启动

Jboss server unable to start after point to another database server

美好的一天,

目前我有一个 Web 应用程序部署 Jboss Server 7.1.4.GA。 我有一个 db2 数据库服务器,数据库名称为 mydb,IP 地址为 10.8.12.167。 Db2 版本为 10.8.5。我通过 运行ning 初始脚本创建 mydb 数据库,例如创建 table、插入预加载数据等。

在 Jboss 控制台中,我将服务器配置为指向 mydb,Web 应用程序运行正常。

现在有一个新的数据库服务器,ip地址10.8.112.63。我给它安装了相同版本的 db2 数据库。不同的是,我没有运行那些初始脚本,我只是从10.8.12.167做数据库备份,然后在这里恢复。

在Jboss控制台,我把数据库ip改成10.8.112.63,测试连接成功。但是,当我想启用我的服务器组的部署时,它会 运行 直到某个时间点并超时。以下是来自我的 Jboss 服务器的 server.log:

18:33:29,938 INFO  [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] (ServerService Thread Pool -- 87) Building JPA container EntityManagerFactory for persistence unit 'IBSJPA'
2020-03-18 18:38:23,332 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'deploy' at address '[("deployment" => "IBSApiEAR.ear")]'
18:38:23,332 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'deploy' at address '[("deployment" => "IBSApiEAR.ear")]'
2020-03-18 18:38:23,336 ERROR [org.jboss.as.server] (ServerService Thread Pool -- 25) WFLYSRV0021: Deploy of deployment "IBSApiEAR.ear" was rolled back with the following failure message: "WFLYCTL0344: Operation timed out awaiting service container stability"
18:38:23,336 ERROR [org.jboss.as.server] (ServerService Thread Pool -- 25) WFLYSRV0021: Deploy of deployment "IBSApiEAR.ear" was rolled back with the following failure message: "WFLYCTL0344: Operation timed out awaiting service container stability"
2020-03-18 18:38:28,332 INFO  [org.jboss.as.protocol] (ServerService Thread Pool -- 89) WFLYPRT0057:  cancelled task by interrupting thread Thread[ServerService Thread Pool -- 25,5,ServerService ThreadGroup]
18:38:28,332 INFO  [org.jboss.as.protocol] (ServerService Thread Pool -- 89) WFLYPRT0057:  cancelled task by interrupting thread Thread[ServerService Thread Pool -- 25,5,ServerService ThreadGroup]
2020-03-18 18:38:28,331 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) WFLYCTL0190: Step handler org.jboss.as.server.deployment.DeploymentHandlerUtil@6ec64843 for operation deploy at address [("deployment" => "IBSApiEAR.ear")] failed handling operation rollback -- java.lang.InterruptedException: java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at org.jboss.as.controller.OperationContextImpl.waitForRemovals(OperationContextImpl.java:515)
    at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1485)
    at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1439)
    at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1412)
    at org.jboss.as.controller.AbstractOperationContext$Step.access0(AbstractOperationContext.java:1286)
    at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:859)
    at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:709)
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:450)
    at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1402)
    at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:418)
    at org.jboss.as.controller.ModelControllerImpl.lambda$execute(ModelControllerImpl.java:243)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:263)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:229)
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:243)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler.internalExecute(TransactionalProtocolOperationHandler.java:249)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.doExecute(TransactionalProtocolOperationHandler.java:190)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:143)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:139)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:263)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:229)
    at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:198)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:162)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:158)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.execute(TransactionalProtocolOperationHandler.java:158)
    at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl.doExecute(ManagementRequestContextImpl.java:70)
    at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$AsyncTaskRunner.run(ManagementRequestContextImpl.java:160)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)

18:38:28,331 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) WFLYCTL0190: Step handler org.jboss.as.server.deployment.DeploymentHandlerUtil@6ec64843 for operation deploy at address [("deployment" => "IBSApiEAR.ear")] failed handling operation rollback -- java.lang.InterruptedException: java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at org.jboss.as.controller.OperationContextImpl.waitForRemovals(OperationContextImpl.java:515)
    at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1485)
    at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1439)
    at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1412)
    at org.jboss.as.controller.AbstractOperationContext$Step.access0(AbstractOperationContext.java:1286)
    at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:859)
    at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:709)
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:450)
    at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1402)
    at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:418)
    at org.jboss.as.controller.ModelControllerImpl.lambda$execute(ModelControllerImpl.java:243)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:263)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:229)
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:243)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler.internalExecute(TransactionalProtocolOperationHandler.java:249)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.doExecute(TransactionalProtocolOperationHandler.java:190)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:143)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:139)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:263)
    at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:229)
    at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:198)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:162)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.run(TransactionalProtocolOperationHandler.java:158)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.as.controller.remote.TransactionalProtocolOperationHandler$ExecuteRequestHandler.execute(TransactionalProtocolOperationHandler.java:158)
    at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl.doExecute(ManagementRequestContextImpl.java:70)
    at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$AsyncTaskRunner.run(ManagementRequestContextImpl.java:160)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)

2020-03-18 18:38:33,336 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) WFLYCTL0349: Timeout after [5] seconds waiting for service container stability while finalizing an operation. Process must be restarted. Step that first updated the service container was 'deploy' at address '[("deployment" => "IBSApiEAR.ear")]'
18:38:33,336 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) WFLYCTL0349: Timeout after [5] seconds waiting for service container stability while finalizing an operation. Process must be restarted. Step that first updated the service container was 'deploy' at address '[("deployment" => "IBSApiEAR.ear")]'

有人知道这是怎么回事以及如何解决这个问题吗?或者我可以进一步查看另一个日志?

最后找到了根本原因

这是因为我的应用程序和新数据库之间的防火墙阻塞。

即使我可以从我的应用程序 ping 数据库 ip 和 telnet 端口,但它仍然有一些防火墙规则阻止访问。

我让网络团队把规则关掉后,就运行顺利了。

我遇到了同样的问题,但在设置了更高的超时后,它起作用了。 尝试添加

<property name="jboss.as.management.blocking.timeout" value="600"/>

到 JBoss 中的 系统属性 部分 standalone.xml。