Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix archive Rest API - RESTEASY004687: Please close clients yourself. #168

Closed
rsoika opened this issue Nov 25, 2022 · 0 comments
Closed
Labels
Milestone

Comments

@rsoika
Copy link
Member

rsoika commented Nov 25, 2022

The ArchiveRemoteService method loadFileFromArchive produces messages like this:

11:42:40,475 WARN [org.jboss.resteasy.client.jaxrs.i18n] (Finalizer) RESTEASY004687: Closing a class org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine instance for you. Please close clients yourself.

We should close the client in this method:

...
    Client client = ClientBuilder.newClient();
    WebTarget target = client.target(url);
    Response response = target.request().post(Entity.entity(user, mediaType));

    try {
        if (response.getStatus() != 200) {
            throw new RuntimeException("Failed with HTTP error code : " + response.getStatus());
        }
        System.out.println("Successfully got result: " + response.readEntity(String.class));
    } finally {
        response.close();
        client.close();
    }
@rsoika rsoika added the bug label Nov 25, 2022
@rsoika rsoika added this to the 2.3.0 milestone Nov 25, 2022
rsoika added a commit that referenced this issue Nov 25, 2022
Issue #168
@rsoika rsoika closed this as completed Jan 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant