Netbeans不知道Wildfly已经启动

Netbeans不知道Wildfly已经启动,netbeans,wildfly,Netbeans,Wildfly,我将netbeans 11.2与wildfly 15应用服务器一起使用。当我尝试运行我的测试应用程序时,在部署后,我会出现以下错误: WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use. 问题是,当我点击Run按钮时,服务器启动,然后部署应用程序,然后Netbeans尝试再次启动服务器,而不知道它已经启动了。 可以在运行输出中看到: Deploying on WildFly Ap

我将netbeans 11.2与wildfly 15应用服务器一起使用。当我尝试运行我的测试应用程序时,在部署后,我会出现以下错误:

WildFly Application Server Start Failed. HTTP Connector port 8080 is already in use.
问题是,当我点击Run按钮时,服务器启动,然后部署应用程序,然后Netbeans尝试再次启动服务器,而不知道它已经启动了。 可以在运行输出中看到:

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)

现在我不知道如何解决这个问题。

这个问题的关键是向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}"/>

在命令提示符下使用以下命令:它将终止端口8080


对于“netstat-aon^ find:8080^ find LISTENING”do taskkill/f/pid%a中的/f tokens=5%a,我在netbeans 10中遇到了相同的问题,通过使用夜间构建版本解决了这个问题。有没有可能,即使它在NB 10的夜间版本中得到解决,它在11.2中仍然是一个问题?[1]Wildfly 18在NetBeans11.2上对我来说运行良好。是否可以升级到最新的Wildfly版本?[2] 作为一种可能的解决方法,不要从上下文菜单中选择Run,请尝试先选择Deploy,如果可以,然后选择Run。这是否有效,或者您是否仍然得到相同的端口8080已在使用错误?[3] 当您尝试运行应用程序并出现错误时,是否有任何相关内容写入NetBeans日志视图>IDE日志?[1]目前无法升级。[2] 我不明白,部署不在上下文菜单中。如果您是指mvn部署,我需要在pom.xml中设置分发管理,我不知道这会有什么帮助。[3] 我已经更新了问题和未解决的IDE日志,确实有一些wierd的东西。从IDE日志可以看出,netbeans正在尝试在端口9999上通信。将管理本机接口添加到standalone.xml后,它开始工作。谢谢你的建议。