【问题标题】:Could not connect to http-remoting - Maven-Wildfly plugin无法连接到 http-remoting - Maven-Wildfly 插件
【发布时间】:2015-11-24 05:42:45
【问题描述】:

我正在尝试使用 Wildfly-Maven 插件在构建过程中使用 Deploying to Wildfly 9 的功能。由于以下错误,我无法部署应用程序。

2015-08-29 15:24:55,720 ERROR [org.jboss.remoting.remote.connection] (XNIO-1 I/O-1) JBREM000200: Remote connection failed: java.io.IOException: An existing connection was forcibly closed by the remote host

请查看我的 pom.xml 的附件部分。

<plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.0.2.Final</version>
            <configuration>
                <username>admin</username>
                <password>password</password>
                <hostname>127.0.0.1</hostname>
                <name> InspiralWeb-1.0-SNAPSHOT.war</name>
                <jbossHome>C:\Wildfly\wildfly-9.0.1.Final</jbossHome>
            </configuration>
            <executions>
                <execution>
                    <phase>install</phase>
                    <goals>
                        <goal>deploy</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

standalone.xml 中的端口没有偏移,所以我确定管理套接字绑定的端口在 9990 上,这是预期的。目前尚不清楚这是我的设置问题还是某些网络问题,我也在本地运行它(您可能可以通过主机名判断)。

有人想吗?

请查看随附的 Stacktrace

Caused by: java.io.IOException: java.net.ConnectException: JBAS012174: Could not connect to remote://127.0.0.1:9990. The connection failed
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
    at org.wildfly.plugin.common.AbstractServerConnection.isDomainServer(AbstractServerConnection.java:245)
    ... 27 more
Caused by: java.net.ConnectException: JBAS012174: Could not connect to remote://127.0.0.1:9990. The connection failed
    at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:117)
    at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256)
    at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
    at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:204)
    at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:148)
    at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:67)
    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:117)
    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:92)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:236)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:141)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
    ... 29 more
Caused by: java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)
    at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:319)
    at org.xnio.nio.WorkerThread.run(WorkerThread.java:539)
    at ...asynchronous invocation...(Unknown Source)
    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:272)
    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:253)
    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:351)
    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:339)
    at org.jboss.as.protocol.ProtocolConnectionUtils.connect(ProtocolConnectionUtils.java:78)
    at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:109)
    ... 39 more

【问题讨论】:

  • 检查服务器日志中的错误消息以及侦听器端口和地址的绑定消息。也许它会绑定到 ::1 而不是或类似的。
  • server.log 中的确切错误消息如下..2015-08-29 14:50:20,914 ERROR [org.jboss.remoting.remote.connection](默认 I/O- 1)JBREM000200:远程连接失败:java.io.IOException:现有连接被远程主机强行关闭
  • 客户端呢?
  • 就侦听器端口/地址而言,这是我发现的。 2015-08-29 12:36:08,305 INFO [org.jboss.as](控制器引导线程)​​WFLYSRV0060:Http 管理接口监听127.0.0.1:9990/management
  • 我认为 jboss 远程处理不是使用 http 接口,而是使用 9999 上的本地接口(至少对于一些旧版本,不确定何时引入了协议升级)。

标签: java maven wildfly


【解决方案1】:

我不是 100% 确定为什么,它必须以这种方式完成,但在我开始在域模式下运行而不是独立运行后,它开始工作。

eckes 所说的也是正确的,“不确定“必须启用什么”(本机 API 端点与主机控制器或独立服务器位于同一位置。要使用 CLI,必须启用它。默认情况下,它在 docs.jboss.org/author/display/WFLY8/... 中的端口 9999 上运行。意思是。尝试 telnet 到 9999 并使用 jboss-cli。"

不仅如此,我还必须通过 CLI 连接到 localhost:9999。这似乎成功了,所以我可以使用 maven-wildfly 插件进行远程部署。

似乎仍然存在一些连接问题,因为它似乎总是在安装阶段初始部署失败,并构建战争。所以我承认这根本不是最好的解决方案。

与域模式相比,我没有对standalone.xml 与 domain.xml 进行对比,以查看 Wildfly 9 Standalone 模式是否默认禁用某些功能。

【讨论】:

    【解决方案2】:

    问题的原因可能是以下之一:

    • 只有当 WildFly 监听其管理端口(默认为 9990)时,才会通过 wildfly-maven-plugin 插件部署任何存档(jar、war、ear)。因此,请确保 WildFly 正在其管理端口侦听。
    • 如果 WildFly 正在其管理端口侦听,请检查您位于 %SYSTEM_ROOT%\System32\drivers\etc 的 Windows 计算机主机文件是否配置正确。即,您的本地主机已正确映射为 IPv4 和 IPv6。

    127.0.0.1 本地主机

    ::1 本地主机

    【讨论】:

      猜你喜欢
      • 2018-06-30
      • 1970-01-01
      • 2014-12-04
      • 2018-04-29
      • 2016-05-10
      • 2015-01-22
      • 2020-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多