jboss 部署时Wildfly Http接口未侦听

piwo6bdm  于 2022-11-08  发布在  其他
关注(0)|答案(2)|浏览(210)

**上下文:**我尝试在同一个服务器中部署两个工件appA.war和appB.war。在启动期间,appB向appA发出http请求,因此appB.war在启动时依赖于另一个工件,因此我在jboss-all.xml中声明了该依赖关系

<jboss umlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0"
                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               xsi:schemaLocation="urn:jboss:deployment-dependencies:1.0 ">
    <dependency name="appA.war"/>
</jboss-deployment-dependencies>

**问题:**依赖关系规则按预期工作。但在容器重新启动期间,HTTP请求被拒绝,即使我无限重试也是如此。只有在wildfly完全启动后,才会处理请求。看起来接口在部署扫描期间未设置或被禁用。我在日志中发现了此问题

2021-04-24 13:52:53,846 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0003: Undertow 2.2.5.Final starting
2021-04-24 13:52:53,967 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 74) WFLYUT0014: Creating file handler for path '/opt/wildfly/develop/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
2021-04-24 13:52:53,976 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0012: Started server default-server.
2021-04-24 13:52:53,977 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) Queuing requests.
2021-04-24 13:52:53,978 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
2021-04-24 13:52:54,044 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8081
2021-04-24 13:52:54,170 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0493: Jakarta Enterprise Beans subsystem suspension complete
2021-04-24 13:52:54,249 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
2021-04-24 13:52:54,324 INFO  [org.jboss.as.patching] (MSC service thread 1-8) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
2021-04-24 13:52:54,352 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-7) WFLYDS0013: Started FileSystemDeploymentService for directory /opt/wildfly/develop/standalone/deployments
2021-04-24 13:52:54,356 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "appA.war" (runtime-name: "holiday.war")
2021-04-24 13:52:54,359 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "appB.war" (runtime-name: "configuracion.war")
2021-04-24 13:52:54,478 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8444
2021-04-24 13:52:54,531 INFO  [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.4.3.Final (Apache CXF 3.3.10)

你知道怎么解决这个问题吗?或者有什么变通办法吗?

rekjcdws

rekjcdws1#

服务器在完成启动之前不接受外部连接是预期的行为。您可以尝试

  • 禁用此行为(我不建议)
  • 启动服务器,但不部署任何应用程序。然后使用cli逐个部署
  • 只需运行两个不同的服务器示例,每个示例运行一个应用程序

或者,如果您知道这两个应用程序总是在同一个服务器上,则切换到in-vm调用(如进行ejb调用),而不是http,对于同一个jvm中的两个项目来说,http是效率低得多的通信方式

相关问题