-
Notifications
You must be signed in to change notification settings - Fork 493
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
Issue with using HotSwapAgent with Jersey2 endpoints with some injections in it #185
Comments
Thanks for feedback. We're working on Payara support now and I've already noticed the first exception, I ignored it in my test project and hotswap works. The source of this problem looks clear, HA registers WebappClassLoader but it has not been started yet. |
There is new fix for first issue, the next one requires much more work. I don't use hk2, any volunteer? |
Thank you for quick fix the part of the problem. Also I noticed that restart of Jersey container doesn't work in case if I add a new injectee to the Jersey endpoint. After the HotSwap I got:
Probably the hk2 should be somehow restarted together with Jersey container.... |
Are you using HotswapAgent v1.0 or v1.1 at least ? According line numbers (Jersey2Plugin.java:143) you have some old one... |
I tried on 1.0 and also with the latest builded SNAPSHOT version from yesterday. |
Ok, then you supply wrong stack trace, look at line 143: In the latest version your call should be from this line (anonymous class): |
Yep, you are right. I have the old one in "glassfish\domains\domain1\lib\ext" Tried to test it with release version 1.0 and I have no "Error reloading Jersey Container". At least yet :) |
@skybber But I think that issue should not be closed until the UnsatisfiedDependencyException for |
Probably this one already opened: #191 |
Could you provide StatutEndpoint class? We should probably extend reload triggers in appropriate code in JerseyPlugin |
|
Are you using plain HK2 or some bridged external DI library like Guice? |
In this particular case it is HK2 DI. |
I have tested HK2 injection on simple hotswap project. If I change injection points, the hotswap works. Could you create minimalistic example to reproduce your problem? |
Here is an example which I have made: https://github.com/dmitry-zhuravlev/HotswapAgentExamples/tree/payara-jersey2/payara-jersey2
|
Thanks for example. Looks there is glassfish specific problem with Jersey2/HK2 reloading. |
Since we had the same error (org.glassfish.hk2.api.UnsatisfiedDependencyException) under Glassfish 4.1, build 13 we tested with the latest/last 4.1 version of Payara (4.1.2.181). Following the mentioned info/warning during startup for the sake of completeness - if necessary we can provide the full stacktraces
|
Tried to use HotSwapAgent with DCEVM light for SDK 8u112 with Payara 4.1.1.162 server. I have some Jersey 2 endpoins with some injections via @Inject. During reload I got several:
When I tried to reach the given endpoint the Payara throw exception like:
So the injection of
HealthCheckRegistryInitializer
toStatusEndpoint
failed. The same situation happened if I have @interceptors definition on top of StatusEndpoint.However if I have a plain Jersey 2 endpoint without any @interceptors and @Inject the hot swap completes successfully.
The text was updated successfully, but these errors were encountered: