我正在使用netbeans 11.2和wildfly 15应用服务器。当我尝试运行我的测试应用程序时,在部署之后,我得到了这个错误:
WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use.问题是,当我单击Run按钮时,服务器启动,然后部署应用程序,然后Netbeans尝试重新启动服务器,而不知道它已经启动。它可以在Run输出中看到:
Deploying on WildFly Application Server
profile mode: false
debug mode: false
force redeploy: true
Starting WildFly Application Server
WildFly Application Server Started
Distributing D:\BIOS\iRegPg\iRegPriv\target\iRegPrivPG-TEST_3.1.4.war
java.lang.reflect.InvocationTargetException
cd D:\BIOS\iRegPg\iRegPriv; JAVA_HOME=C:\\Java\\jdk1.8.0_231 cmd /c "\"\"C:\\Program Files\\NetBeans-11.2\\netbeans\\java\\maven\\bin\\mvn.cmd\" -Dnetbeans.deploy=true -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans-11.2\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 -PIREG_TEST package\""
Scanning for projects...
Some problems were encountered while building the effective model for cz.bios.ireg:iRegPrivPG:war:TEST_3.1.4
'version' contains an expression but should be a constant. @ cz.bios.ireg:iRegPrivPG:${version.prefix}_3.1.4, D:\BIOS\iRegPg\iRegPriv\pom.xml, line 7, column 14
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
------------------------------------------------------------------------
Building iRegPrivPG TEST_3.1.4
------------------------------------------------------------------------
--- maven-dependency-plugin:2.6:copy (default) @ iRegPrivPG ---
--- maven-resources-plugin:2.6:resources (default-resources) @ iRegPrivPG ---
Using 'UTF-8' encoding to copy filtered resources.
Copying 0 resource
--- maven-compiler-plugin:3.1:compile (default-compile) @ iRegPrivPG ---
Nothing to compile - all classes are up to date
--- maven-resources-plugin:2.6:testResources (default-testResources) @ iRegPrivPG ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory D:\BIOS\iRegPg\iRegPriv\src\test\resources
--- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ iRegPrivPG ---
Nothing to compile - all classes are up to date
--- maven-surefire-plugin:2.12.4:test (default-test) @ iRegPrivPG ---
--- maven-war-plugin:2.3:war (default-war) @ iRegPrivPG ---
Packaging webapp
Assembling webapp [iRegPrivPG] in [D:\BIOS\iRegPg\iRegPriv\target\iRegPrivPG-TEST_3.1.4]
Processing war project
Copying webapp webResources [D:\BIOS\iRegPg\iRegPriv/src/main/webapp] to [D:\BIOS\iRegPg\iRegPriv\target\iRegPrivPG-TEST_3.1.4]
Copying webapp resources [D:\BIOS\iRegPg\iRegPriv\src\main\webapp]
Webapp assembled in [344 msecs]
Building war: D:\BIOS\iRegPg\iRegPriv\target\iRegPrivPG-TEST_3.1.4.war
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 2.052 s
Finished at: 2019-12-12T12:23:44+01:00
Final Memory: 14M/251M
------------------------------------------------------------------------
Deploying on WildFly Application Server
profile mode: false
debug mode: false
force redeploy: true
Starting WildFly Application Server
WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use.IDE日志:
java.net.ConnectException: WFLYPRT0023: Could not connect to remote://localhost:9999. The connection timed out
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:130)
at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:259)
at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.getChannel(ManagementClientChannelStrategy.java:167)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:146)
at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:60)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:135)
at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:110)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:263)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:168)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)
Caused: java.io.IOException
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:75)
Caused: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.executeOnModelNode(WildflyClient.java:267)
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.undeploy(WildflyClient.java:529)
Caused: java.io.IOException
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.undeploy(WildflyClient.java:535)
at org.netbeans.modules.javaee.wildfly.ide.commands.WildflyClient.deploy(WildflyClient.java:547)
[catch] at org.netbeans.modules.javaee.wildfly.WildflyDeploymentManager.distribute(WildflyDeploymentManager.java:190)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:684)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:221)
at org.netbeans.modules.maven.j2ee.execution.DeploymentHelper.perform(DeploymentHelper.java:185)
at org.netbeans.modules.maven.j2ee.execution.CoSAlternativeExecutorImpl.execute(CoSAlternativeExecutorImpl.java:67)
at org.netbeans.modules.maven.cos.CoSAlternativeExecutor.execute(CoSAlternativeExecutor.java:64)
at org.netbeans.modules.maven.cos.CosChecker.checkRunMainClass(CosChecker.java:184)
at org.netbeans.modules.maven.cos.CosChecker.checkRunConfig(CosChecker.java:138)
at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:213)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
INFO [org.netbeans.modules.j2ee.deployment.impl.TargetServer]: Cannot incrementally deploy to more than one target
INFO [org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment]
The module has not been deployed.
See the server log for details.
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:234)
at org.netbeans.modules.maven.j2ee.execution.DeploymentHelper.perform(DeploymentHelper.java:185)
at org.netbeans.modules.maven.j2ee.execution.CoSAlternativeExecutorImpl.execute(CoSAlternativeExecutorImpl.java:67)
at org.netbeans.modules.maven.cos.CoSAlternativeExecutor.execute(CoSAlternativeExecutor.java:64)
at org.netbeans.modules.maven.cos.CosChecker.checkRunMainClass(CosChecker.java:184)
at org.netbeans.modules.maven.cos.CosChecker.checkRunConfig(CosChecker.java:138)
at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:213)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
INFO [org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment]
org.netbeans.modules.j2ee.deployment.impl.ServerException: WildFly Application Server (15 - OLD) Start Failed. HTTP Connector port 8080 is already in use.
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance._startDebug(ServerInstance.java:1477)
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.startTarget(ServerInstance.java:1382)
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.startDebug(ServerInstance.java:1095)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.startTargets(TargetServer.java:514)
[catch] at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:190)
at org.netbeans.modules.maven.j2ee.execution.DeploymentHelper.perform(DeploymentHelper.java:185)
at org.netbeans.modules.maven.j2ee.execution.ExecutionChecker.executionResult(ExecutionChecker.java:70)
at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:303)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
WARN [org.xnio.future]: XNIO001003: Running IoFuture notifier org.jboss.remoting3.remote.RemoteConnectionProvider$6@292032de failed
java.util.concurrent.RejectedExecutionException: Endpoint is not open
at org.jboss.remoting3.EndpointImpl.executorUntick(EndpointImpl.java:374)
at org.jboss.remoting3.EndpointImpl$TrackingExecutor.execute(EndpointImpl.java:945)
at org.xnio.AbstractIoFuture.runNotifier(AbstractIoFuture.java:693)
at org.xnio.AbstractIoFuture$NotifierState.doNotify(AbstractIoFuture.java:267)
at org.xnio.AbstractIoFuture$NotifierState.notifyCancelled(AbstractIoFuture.java:258)
at org.xnio.AbstractIoFuture$CancelRequestedState.notifyCancelled(AbstractIoFuture.java:369)
at org.xnio.AbstractIoFuture.setCancelled(AbstractIoFuture.java:643)
at org.xnio.FutureResult.setCancelled(FutureResult.java:98)
at org.jboss.remoting3.remote.RemoteConnectionProvider$6.handleCancelled(RemoteConnectionProvider.java:252)
at org.jboss.remoting3.remote.RemoteConnectionProvider$6.handleCancelled(RemoteConnectionProvider.java:250)
at org.xnio.IoFuture$HandlingNotifier.notify(IoFuture.java:204)
[catch] at org.xnio.AbstractIoFuture$NotifierRunnable.run(AbstractIoFuture.java:720)
at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:612)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:479)现在我不知道如何解决这个问题。
发布于 2019-12-13 17:38:39
这个问题的关键是将本机管理接口添加到wildfly配置文件中,如下所示:
<management-interfaces>
<native-interface security-realm="ManagementRealm">
<socket-binding native="management-native"/>
</native-interface>
<http-interface security-realm="ManagementRealm">
<http-upgrade enabled="true"/>
<socket-binding http="management-http"/>
</http-interface>
</management-interfaces>然后
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>发布于 2020-03-09 18:46:04
在命令提示符下使用以下命令:它将终止端口8080
对于('netstat -aon ^| /f ":8080“^| find”:8080“^| find”侦听“‘)中的tokens=5”侦听“%a,请执行taskkill /f /pid %a
https://stackoverflow.com/questions/59303601
复制相似问题