Closing a class org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine instance for you. Please close clients yourself.

3,623 views
Skip to first unread message

David Hoffer

unread,
May 14, 2021, 11:20:30 AM5/14/21
to Quarkus Development mailing list
Testing with 1.13.2.Final has a lot of these in the logs.

Is this a bug in Quarkus?  This looks like framework code not any of our app logic.

2021-05-14 15:16:47,990 WARN  (Finalizer) [org.jboss.resteasy.client.jaxrs.i18n.finalize()] RESTEASY004687: Closing a class org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine instance for you. Please close clients yourself.

2021-05-14 15:16:47,993 WARN  (Finalizer) [org.jboss.resteasy.client.jaxrs.i18n.finalize()] RESTEASY004687: Closing a class org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine instance for you. Please close clients yourself.

-Dave

Stuart Douglas

unread,
May 16, 2021, 7:59:29 PM5/16/21
to David Hoffer, Quarkus Development mailing list
Which extensions are you using?

Stuart

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/4254a374-b839-48b1-a58b-f140d010483bn%40googlegroups.com.

David Hoffer

unread,
May 17, 2021, 12:36:41 AM5/17/21
to Quarkus Development mailing list
I believe these are all of our Quarkus dependencies.

 <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-multipart</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.slf4j</groupId>
<artifactId>slf4j-jboss-logmanager</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-config-yaml</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-narayana-jta</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-agroal</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-elytron-security-jdbc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-fault-tolerance</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-infinispan-embedded</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-elytron-security-properties-file</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>log4j-jboss-logmanager</artifactId>
</dependency>

Stephane Epardaud

unread,
May 19, 2021, 5:54:39 AM5/19/21
to David Hoffer, Quarkus Development mailing list
This looks like the rest-client fails to close connections.



--
Stéphane Épardaud

Aaron Coburn

unread,
May 19, 2021, 9:31:01 AM5/19/21
to Quarkus Development mailing list
This may be helpful: https://download.eclipse.org/microprofile/microprofile-rest-client-1.3/microprofile-rest-client-1.3.html#lifecycle

and https://docs.jboss.org/resteasy/docs/4.5.12.Final/userguide/html/MicroProfile_Rest_Client.html#d4e3810

If you cast the client to java.io.Closeable or java.lang.AutoCloseable, you can use the client in a try-with-resources structure. Or even better, if the client interface extends Closeable/AutoCloseable, you won't need to cast the client object at all.

Aaron

David Hoffer

unread,
May 19, 2021, 10:03:08 AM5/19/21
to aaron....@gmail.com, Quarkus Development mailing list
This would be a bug in Quarkus or whatever code is using that client.  We don't use it in our application code but we had to add that dependency as it was needed for some Quarkus functionality (I forget the error we get if we don't have that dependency).

Can we get a service pack fix for this issue?

-Dave

Guillaume Smet

unread,
May 19, 2021, 12:56:22 PM5/19/21
to David Hoffer, aaron....@gmail.com, Quarkus Development mailing list
On Wed, May 19, 2021 at 4:03 PM David Hoffer <dhof...@gmail.com> wrote:
This would be a bug in Quarkus or whatever code is using that client.  We don't use it in our application code but we had to add that dependency as it was needed for some Quarkus functionality (I forget the error we get if we don't have that dependency).

Can we get a service pack fix for this issue?

Well, first, we would need to understand what's going on.

So please open a GitHub issue with a small reproducer.

Thanks.

Stuart Douglas

unread,
May 19, 2021, 7:51:00 PM5/19/21
to David Hoffer, aaron....@gmail.com, Quarkus Development mailing list
On Thu, 20 May 2021 at 00:03, David Hoffer <dhof...@gmail.com> wrote:
This would be a bug in Quarkus or whatever code is using that client.  We don't use it in our application code but we had to add that dependency as it was needed for some Quarkus functionality (I forget the error we get if we don't have that dependency).

If a Quarkus extension needs this then it should automatically pull it in, what error do you get if you remove it?

Stuart
 

David Hoffer

unread,
May 19, 2021, 8:27:13 PM5/19/21
to Stuart Douglas, aaron....@gmail.com, Quarkus Development mailing list
I searched my prior posts and found it.

The subject of the prior discussion is: ClassNotFoundException after upgrading from 1.12.2.Final to 1.13.1.Final

The error was:
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.client.JerseyClientBuilder
    at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:102)
    at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:113)

You replied back with this fix:
It looks like resteasy has split the client into a separate artifact, if you include 'quarkus-rest-client' it should work.

We added 'quarkus-rest-client' and the error was resolved.

Now we have this new warning using this artifact:

Closing a class org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine instance for you. Please close clients yourself.

We are using 1.13.2.Final

-Dave

Stuart Douglas

unread,
May 19, 2021, 8:35:59 PM5/19/21
to David Hoffer, aaron....@gmail.com, Quarkus Development mailing list
On Thu, 20 May 2021 at 10:27, David Hoffer <dhof...@gmail.com> wrote:
I searched my prior posts and found it.

The subject of the prior discussion is: ClassNotFoundException after upgrading from 1.12.2.Final to 1.13.1.Final

The error was:
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.client.JerseyClientBuilder
    at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:102)
    at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:113)

You replied back with this fix:
It looks like resteasy has split the client into a separate artifact, if you include 'quarkus-rest-client' it should work.

We added 'quarkus-rest-client' and the error was resolved.


What is the full stack trace? If you are not actually using quarkus-rest-client then what is using this?

Note that quarkus-rest-client is a bit of overkill to fix that error, technically you only need org.jboss.resteasy:resteasy-client, its a bit confusing as
there are two different clients, there is the RESTEasy one, which is an implementation on the JAX-RS client, and then there is quarkus-rest-client
which implements the Microprofile rest client spec, and is based on the RESTEasy client.

Stuart

David Hoffer

unread,
May 20, 2021, 7:27:58 PM5/20/21
to Quarkus Development mailing list
Please disregard this issue.  

I reviewed the prior error and found we do have some places where we use a JAX-RS Client and it is loading a client implementation provided via quarkus-rest-client and we failed to close the client.  This was my bad and has been fixed.

-Dave

Reply all
Reply to author
Forward
0 new messages