Remote deployment via management API of WAR in Wildfly (running in Docker)

Answered

Hi together!

I want to develop a JEE application using Docker. So I spin up a Wildfly Application Server in a Docker container. Everything is fine and working. A have access to the management console and so on.

Now, I want to deploy (and later debug) a JEE application. At the moment I'm playing around with a simple Hello World app. Therefore I create a run configuration of type "JBOSS Server remote". Before, I downloaded a version of Wildfly (same version as in container) and selected it in the field "Application server". BTW, why do I need a local copy of the Wildfly server. Is the Wildfly inside the container not enough? Only to use the jboss-cli?

When I start the configuration I get the following error:
```
Error running 'docker-wildfly-remote'
Unable to connect to the localhost:9999, reason:
com.intellij.javaee.process.common.WrappedException: java.io.IOException: java.net.ConnectException: WFLYPRT0023: Could not connect to remote://localhost:9999. The connection timed out
```

When I connect to the server via CLI with this command. This works:
```sh
./jboss-cli.bat --connect --controller=remote+http://localhost:9999
```

But I get the exact same error which is IntelliJ complaining about if I use this command:
```sh
./jboss-cli.bat --connect --controller=remote://localhost:9999

Failed to connect to the controller: The controller is not available at localhost:9999: java.net.ConnectException: WFLYPRT0023: Could not connect to remote://localhost:9999. The connection timed out: WFLYPRT0023: Could not connect to remote://localhost:9999. The connection timed out
```

It seems that "+http" is missing in the connection (controller) string.
What I'm doing wrong? Didn't found a tutorial or solution in the internet.

Best regards,
Kersten

0
10 comments

Do not use port 9999 and also not 9990 if you have a Nvidia graphic card. This fixed the problem.

1
Avatar
Permanently deleted user

Kersten Lorenz Thanks for your post. I observed the same behavior. Hopefully changing the port will resolve this issue :-)

0

Hello,
I'm currently facing the same issue, but I don't have a Nvidia but an Intel Graphic card. Is there any other way how to solve this?

0

Hello,

Have you tried to change port?

0

Yes, I did but I still got the error.

When I was checking the idea.log file, I found these errors:

2022-10-07 17:30:54,708 [ 975324]   INFO - STDERR - Exception in thread "DisconnectableInputStream source reader" org.gradle.api.UncheckedIOException: java.nio.channels.AsynchronousCloseException
2022-10-07 17:30:54,708 [ 975324]   INFO - STDERR -     at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61)
2022-10-07 17:30:54,708 [ 975324]   INFO - STDERR -     at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
2022-10-07 17:30:54,708 [ 975324]   INFO - STDERR -     at org.gradle.util.DisconnectableInputStream$1.run(DisconnectableInputStream.java:125)
2022-10-07 17:30:54,708 [ 975324]   INFO - STDERR -     at java.base/java.lang.Thread.run(Thread.java:833)
2022-10-07 17:30:54,708 [ 975324]   INFO - STDERR - Caused by: java.nio.channels.AsynchronousCloseException
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/sun.nio.ch.SocketChannelImpl.endRead(SocketChannelImpl.java:389)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:428)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/sun.nio.ch.SourceChannelImpl.read(SourceChannelImpl.java:113)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:59)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:107)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:101)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)
2022-10-07 17:30:54,709 [ 975325]   INFO - STDERR -     at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
2022-10-07 17:30:54,710 [ 975326]   INFO - STDERR -     at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
2022-10-07 17:30:54,710 [ 975326]   INFO - STDERR -     at org.gradle.util.DisconnectableInputStream$1.run(DisconnectableInputStream.java:96)
2022-10-07 17:30:54,710 [ 975326]   INFO - STDERR -     ... 1 more
2022-10-07 17:30:54,780 [ 975396]   INFO - #o.j.p.g.GradleManager - Instructing gradle to use java from C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.322
2022-10-07 17:30:54,781 [ 975397]   INFO - #o.j.p.g.GradleManager - Instructing gradle to use java from C:\Program Files\RedHat\java-1.8.0-openjdk-1.8.0.322
2022-10-07 17:30:54,816 [ 975432]   INFO - #o.j.p.g.s.e.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --init-script C:\Users\tnguyen\AppData\Local\Temp\ijmapper.gradle --init-script C:\Users\tnguyen\AppData\Local\Temp\ijresolvers.gradle --init-script C:\Users\tnguyen\AppData\Local\Temp\ijverspecinit.gradle
2022-10-07 17:30:58,972 [ 979588]   INFO - STDERR - Exception in thread "DisconnectableInputStream source reader" org.gradle.api.UncheckedIOException: java.nio.channels.AsynchronousCloseException
2022-10-07 17:30:58,972 [ 979588]   INFO - STDERR -     at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:61)
2022-10-07 17:30:58,972 [ 979588]   INFO - STDERR -     at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
2022-10-07 17:30:58,972 [ 979588]   INFO - STDERR -     at org.gradle.util.DisconnectableInputStream$1.run(DisconnectableInputStream.java:125)
2022-10-07 17:30:58,973 [ 979589]   INFO - STDERR -     at java.base/java.lang.Thread.run(Thread.java:833)
2022-10-07 17:30:58,973 [ 979589]   INFO - STDERR - Caused by: java.nio.channels.AsynchronousCloseException
2022-10-07 17:30:58,973 [ 979589]   INFO - STDERR -     at java.base/java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
2022-10-07 17:30:58,973 [ 979589]   INFO - STDERR -     at java.base/sun.nio.ch.SocketChannelImpl.endRead(SocketChannelImpl.java:389)
2022-10-07 17:30:58,973 [ 979589]   INFO - STDERR -     at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:428)
2022-10-07 17:30:58,973 [ 979589]   INFO - STDERR -     at java.base/sun.nio.ch.SourceChannelImpl.read(SourceChannelImpl.java:113)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:59)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:107)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at java.base/sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:101)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     at org.gradle.util.DisconnectableInputStream$1.run(DisconnectableInputStream.java:96)
2022-10-07 17:30:58,974 [ 979590]   INFO - STDERR -     ... 1 more
2022-10-07 17:31:08,080 [ 988696]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - java.io.IOException: java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:9990. The connection timed out
java.io.IOException: java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:9990. The connection timed out
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:75)
    at com.intellij.javaee.oss.jboss.agent.JBoss7Agent$Operation.doExecute(JBoss7Agent.java:374)
    at com.intellij.javaee.oss.jboss.agent.JBoss7Agent$Operation.executeOrFail(JBoss7Agent.java:355)
    at com.intellij.javaee.oss.jboss.agent.JBoss7Agent$Operation.execute(JBoss7Agent.java:344)
    at com.intellij.javaee.oss.jboss.agent.JBoss71Agent$1.validate(JBoss71Agent.java:21)
    at com.intellij.javaee.oss.jboss.agent.JBoss7Agent.doConnect(JBoss7Agent.java:77)
    at com.intellij.javaee.oss.agent.SimpleAgentBase$1.doJob(SimpleAgentBase.java:24)
    at com.intellij.javaee.oss.agent.SimpleAgentBase$1.doJob(SimpleAgentBase.java:20)
    at com.intellij.javaee.oss.agent.SimpleAgentJob.perform(SimpleAgentJob.java:12)
    at com.intellij.javaee.oss.agent.SimpleAgentBase.connect(SimpleAgentBase.java:33)
    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 com.intellij.javaee.process.common.MethodInvocator.invoke(MethodInvocator.java:41)
    at com.intellij.javaee.oss.process.JavaeeProcess.processRequest(JavaeeProcess.java:112)
    at com.intellij.javaee.oss.process.JavaeeProcess.run(JavaeeProcess.java:52)
    at com.intellij.javaee.oss.process.JavaeeProcess.main(JavaeeProcess.java:31)
    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 com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:64)
Caused by: java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:9990. 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)
    ... 23 more

2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - Auth: realm
2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - Auth: anonymous
2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - Auth: elytron credentials
2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - Auth: algo: digest-md5, type: class org.wildfly.security.credential.PasswordCredential, supported: false
2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - Auth: username
2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - Auth: algo: clear, type: class org.wildfly.security.credential.PasswordCredential, supported: true
2022-10-07 17:31:08,081 [ 988697]   WARN - #c.i.j.o.s.JavaeeServerInstanceImpl - com.intellij.javaee.process.common.WrappedException: java.io.IOException: java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:9990. The connection timed out
2022-10-07 17:31:08,103 [ 988719]   INFO - #c.i.u.i.s.i.ResponseProcessor - Socket closed
java.net.SocketException: Socket closed
    at java.base/sun.nio.ch.NioSocketImpl.endRead(NioSocketImpl.java:248)
    at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:327)
    at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)
    at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)
    at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
    at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270)
    at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313)
    at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
    at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177)
    at java.base/java.io.BufferedReader.fill(BufferedReader.java:162)
    at java.base/java.io.BufferedReader.readLine(BufferedReader.java:329)
    at java.base/java.io.BufferedReader.readLine(BufferedReader.java:396)
    at com.intellij.javaee.process.common.InputReader.getNextSource(InputReader.java:28)
    at com.intellij.javaee.process.JavaeeProcessExternalizerFactory$2.readResponse(JavaeeProcessExternalizerFactory.java:56)
    at com.intellij.javaee.process.JavaeeProcessExternalizerFactory$2.readResponse(JavaeeProcessExternalizerFactory.java:51)
    at com.intellij.util.io.socketConnection.impl.ResponseProcessor.lambda$startReading$0(ResponseProcessor.java:40)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:297)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)
2022-10-07 17:31:08,106 [ 988722]   INFO - #c.i.e.r.ExecutionUtil - Error running 'Deploy to Wildfly':<br>Unable to connect to the localhost:9990, reason:
com.intellij.javaee.process.common.WrappedException: java.io.IOException: java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:9990. The connection timed out
com.intellij.execution.ExecutionException: Unable to connect to the localhost:9990, reason:
com.intellij.javaee.process.common.WrappedException: java.io.IOException: java.net.ConnectException: WFLYPRT0023: Could not connect to remote+http://localhost:9990. The connection timed out
    at com.intellij.javaee.oss.server.JavaeeServerInstanceImpl$ConnectLogger.throwError(JavaeeServerInstanceImpl.java:580)
    at com.intellij.javaee.oss.server.JavaeeServerInstanceImpl.connect(JavaeeServerInstanceImpl.java:98)
    at com.intellij.javaee.appServers.run.execution.J2EEProcessHandlerWrapper.connectToProcess(J2EEProcessHandlerWrapper.java:363)
    at com.intellij.javaee.appServers.run.execution.J2EERemoteState.startJ2EEProcess(J2EERemoteState.java:38)
    at com.intellij.javaee.appServers.run.execution.J2EEProcessHandlerWrapper.lambda$new$0(J2EEProcessHandlerWrapper.java:96)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:241)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:214)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:203)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)


Do you have any suggestions how to fix this? The access and the manual deployment over the management console (http://localhost:9990/console) using the browser works for me without any problems.

0

Do you use any antivirus software or firewall that might block connections? Also please use "netstat" command in console to check if port is free.

0

Yes, I have an antivirus software and a firewall but it does not block the access since I'm also able to access the web console via the URL http://localhost:9990/console. I even tried to connect to Wildfly directly via jboss-cli and it was working:
Furthermore, I also used "netstat" to check if the port was free and that was indeed the case.
Do you have any suggestion how to troubleshoot and fix this?

0

I tried both approaches, but still it is not working for me:

I'm getting this error:

0

Is it possible to temporarily disable antivirus and firewall? Probably they block calls from IDE.

0

Please sign in to leave a comment.