Both my client and server are running on adopopenjdk 11.0.9.101. I'm running this on Windows 10 Home edition. My client tries to connect to the management REST API. (All of this has worked on Java 8 in the past)
On the server side I have a standard Wildfly 19 server with some mail smtp properties .
<outbound-socket-binding name="mail-smtp">
<remote-destination host="some.smtp.server" port="465"/>
</outbound-socket-binding>
A management user was created called "admin".
The client has a fairly small main method which tries to read these properties.
HttpAuthenticationFeature feature = HttpAuthenticationFeature.digest("admin", "admin");
Client client = ClientBuilder.newClient();
client.register(feature);
WebTarget target = client.target("http://localhost:9990/management")
.path("/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp")
.queryParam("operation", "resource");
Response r = target
.request(MediaType.APPLICATION_JSON)
.get();
Map<String, Object> smtpResponse = r.readEntity(new GenericType<HashMap<String, Object>>() { });
System.out.println(smtpResponse);
This results on the server side in the following output:
11:57:37,054 DEBUG [io.undertow.request] (management I/O-2) Matched prefix path /management for path /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp
11:57:37,054 DEBUG [io.undertow.request.security] (management I/O-2) Setting authentication required for exchange HttpServerExchange{ GET /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp}
11:57:37,056 DEBUG [io.undertow.request] (management I/O-1) Matched prefix path /management for path /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp
11:57:37,056 DEBUG [io.undertow.request.security] (management I/O-1) Setting authentication required for exchange HttpServerExchange{ GET /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp}
11:57:37,226 DEBUG [io.undertow.request] (management I/O-2) Matched prefix path /management for path /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp
11:57:37,227 DEBUG [io.undertow.request.security] (management I/O-2) Setting authentication required for exchange HttpServerExchange{ GET /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp}
11:57:37,227 DEBUG [io.undertow.request.security] (management task-1) Authenticated as admin, roles []
11:57:37,230 DEBUG [io.undertow.request] (management I/O-1) Matched prefix path /management for path /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp
11:57:37,230 DEBUG [io.undertow.request.security] (management I/O-1) Setting authentication required for exchange HttpServerExchange{ GET /management/socket-binding-group/standard-sockets/remote-destination-outbound-socket-binding/mail-smtp}
11:57:37,231 DEBUG [io.undertow.request.security] (management task-1) Authenticated as admin, roles []
11:57:37,249 DEBUG [io.undertow.request.io] (management I/O-2) Error reading request: java.io.IOException: De externe host heeft een verbinding verbroken
at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
at [email protected]//org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:289)
at [email protected]//org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
at [email protected]//io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:158)
at [email protected]//io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at [email protected]//io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at [email protected]//org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at [email protected]//org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at [email protected]//org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
at [email protected]//org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
11:57:37,250 DEBUG [io.undertow.request.io] (management I/O-1) Error reading request: java.io.IOException: De externe host heeft een verbinding verbroken
at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:358)
at [email protected]//org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:289)
at [email protected]//org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
at [email protected]//io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:158)
at [email protected]//io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at [email protected]//io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at [email protected]//org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at [email protected]//org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at [email protected]//org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
at [email protected]//org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
On the client side I can see this
Exception in thread "main" java.lang.IllegalStateException: RESTEASY003765: Response is closed.
at org.jboss.resteasy.specimpl.AbstractBuiltResponse.abortIfClosed(AbstractBuiltResponse.java:308)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.abortIfClosed(ClientResponse.java:290)
at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:59)
at org.jboss.resteasy.specimpl.AbstractBuiltResponse.readEntity(AbstractBuiltResponse.java:270)
at be.cprtest.wildfly.Main.main(Main.java:74)
This is my client's pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>be.bramgadeyne</groupId>
<artifactId>WildflyManagementTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.11.3.Final</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.33</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson-provider</artifactId>
<version>3.11.3.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
<version>2.0.1.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
</project>