Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Intermittent HK2 ServiceLocatorImpl has been shut down #4507

Closed
jansupol opened this issue Jun 16, 2020 · 0 comments
Closed

Intermittent HK2 ServiceLocatorImpl has been shut down #4507

jansupol opened this issue Jun 16, 2020 · 0 comments
Assignees
Milestone

Comments

@jansupol
Copy link
Contributor

When the reference on ClientRuntime is not kept in the code (such as in the Response), the ClientRuntime can get garbage collected. HK2 ServiceLocator is closed then.

Example:

entity = ClientBuilder.newClient().target().request().get(<some.entity.that.uses.messagebodyworkers>)
entity.read()

entity can be EventInput, InboundEvent, ChunkedInput,...

The following exception can be thrown:

java.lang.IllegalStateException: ServiceLocatorImpl(__HK2_Generated_13,13,1665167146) has been shut down
at org.jvnet.hk2.internal.ServiceLocatorImpl.checkState(ServiceLocatorImpl.java:2383)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetInjecteeDescriptor(ServiceLocatorImpl.java:524)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getInjecteeDescriptor(ServiceLocatorImpl.java:571)
at org.jvnet.hk2.internal.IterableProviderImpl.justInTime(IterableProviderImpl.java:75)
at org.jvnet.hk2.internal.IterableProviderImpl.get(IterableProviderImpl.java:84)

@jansupol jansupol self-assigned this Jun 16, 2020
@senivam senivam added this to the 2.32 milestone Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants