java 无法连接到 http-remoting - Maven-Wildfly 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32290070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Could not connect to http-remoting - Maven-Wildfly plugin
提问by broot02
I am attempting to employ the functionality of Deploying to Wildfly 9 in my build process with the Wildfly-Maven plugin. I am unable to deploy the application, due to the following error.
我正在尝试使用 Wildfly-Maven 插件在我的构建过程中使用部署到 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
Please see the attached portion of my pom.xml.
请参阅我的 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>
There is no offset for the port in the standalone.xml, so I am sure the port that the management socket binding is on 9990, which is what is expected. It isn't clear if this is an issue with my setup or some network issue, I am running this locally also(as you can probably tell by the hostname).
Standalone.xml 中的端口没有偏移,所以我确定管理套接字绑定的端口在 9990 上,这是预期的。目前尚不清楚这是我的设置问题还是某些网络问题,我也在本地运行它(正如您可以通过主机名看出的那样)。
Thoughts anyone?
有人想吗?
Please see the attached Stacktrace
请参阅随附的 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.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
回答by broot02
I am not 100% sure as to why, it had to be done this way, but after I started to run in domain mode rather than standalone it started working.
我不是 100% 确定为什么,它必须以这种方式完成,但是在我开始以域模式而不是独立模式运行后,它开始工作。
Also what eckes stated was true as well, "Not sure what "must be enabled" (The native API endpoint is co-located with either the a host controller or a standalone server. To use the CLI it must be enabled. By default, it runs on port 9999) in docs.jboss.org/author/display/WFLY8/… means. Try telnet to 9999 and using jboss-cli."
同样,eckes 所说的也是正确的,“不确定什么”必须启用”(本机 API 端点与主机控制器或独立服务器位于同一位置。要使用 CLI,必须启用它。默认情况下,它在 docs.jboss.org/author/display/WFLY8/... 中的端口 9999 上运行...意味着。尝试 telnet 到 9999 并使用 jboss-cli。”
More so than that I had to connect via the CLI to the localhost:9999. This seemingly made it so I could remotely deploy using the maven-wildfly plugin.
更重要的是,我必须通过 CLI 连接到 localhost:9999。这似乎使我可以使用 maven-wildfly 插件进行远程部署。
There still seems to be some connectivity issues, as it seems to always fail the initial deploy during the install phase, and building the War. So I acknowledge this isn't the best solution at all.
似乎仍然存在一些连接问题,因为它似乎总是在安装阶段和构建War期间的初始部署失败。所以我承认这根本不是最好的解决方案。
I haven't scourged the standalone.xml vs. the domain.xml to see if certain things are disabled by default in Wildfly 9 Standalone mode, as compared to Domain mode.
与域模式相比,我还没有对standalone.xml 与domain.xml 进行对比,以查看在Wildfly 9 Standalone 模式下是否默认禁用了某些内容。
回答by Keshaw Kumar
The reason of the problem could be one of the following:
问题的原因可能是以下之一:
- The deployment of any archive (jar, war, ear) through wildfly-maven-plugin plugin will happen only if the WildFly is listening at its management port which is 9990 by default. So make sure that WildFly is listening at its management port.
- If WildFly is listening at its management port then check if your host file located at %SYSTEM_ROOT%\System32\drivers\etcfor windows machine is configured correctly. i.e. your local host is mapped correctly for both IPv4 and IPv6.
- 只有当 WildFly 正在侦听其管理端口(默认为 9990)时,才会通过 wildfly-maven-plugin 插件部署任何存档(jar、war、ear)。因此,请确保 WildFly 正在侦听其管理端口。
- 如果 WildFly 正在侦听其管理端口,则检查位于%SYSTEM_ROOT%\System32\drivers\etc的 Windows 机器的主机文件是否配置正确。即您的本地主机为 IPv4 和 IPv6 正确映射。
127.0.0.1 localhost
127.0.0.1 本地主机
::1 localhost
::1 本地主机