GuiceResteasyBootstrapServletContextListener Guice is initialized before resteasy boots up
See original GitHub issueReference: https://stackoverflow.com/questions/61330943/guice-resteasy-jaxrs-integration
I am loading Resteasy Resources through subclass of javax.ws.rs.Application I am using GuiceResteasyBootstrapServletContextListener to initialize Guice So I expect the resteasybootstrap to finish loading before Guice is initialized.
in my module class, I am trying to get all singletons of javax.ws.rs.Application and injectMembers to it.
MyWebApplication.get().getSingletons().forEach(api -> requestInjection(api));
I found out that MyWebApplication is not yet loaded when the control reaches my Module class as a result I encounter Nullpointer.
Is there any way to wait till the rest resources are loaded to resteasy and then initiate the Guice Injection?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
RESTEasy JAX-RS - JBoss.org
The initialization of RESTEasy can be performed within a ServletContextListener instead of within the Servlet. You may need this if you are writing...
Read more >Resteasy with Guice configuration issues - Stack Overflow
I'm new to both Resteasy and Guice, but I'm having problems getting the simple tutorial to work. Here are my relevant files.
Read more >RESTEasy Reference Guide JBoss Enterprise Application ...
A reference guide to RESTEasy for use with JBoss Enterprise Application Platform 5 ... The ResteasyBootstrap listener initializes some of RESTEasy's basic ...
Read more >io.undertow.servlet.api.ListenerInfo.<init> java code examples
How to use ... ListenerInfo.<init> (Showing top 20 results out of 315) ... addListener(new ListenerInfo(GuiceResteasyBootstrapServletContextListener.class, ...
Read more >RESTEasy Reference Guide - UserManual.wiki
Tighter integration with JBoss Application Server is also available to make ... Resteasy /* The Resteasy servlet is responsible for initializing some basic ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I really hope I do not get put onto your project - or get your architects on any of mine. ever
But here is the working commit for the servlet module rest easy - This is truly and deeply the wrong path you are taking, especially for starting a new project, and especially that it is a POC. I strongly advise you reconsider your position, and if need be speak to your powers that be and give them the biggest slap across their face that you can possibly manage, maybe use a cricket bat.
NB FOR EVERYONE ELSE!!! - THIS IS THE WRONG IMPLEMENTATION TO GO WITH, DO NOT DO THIS. YOU HAVE BEEN WARNED. YOU WILL NOT GET ANY PERFORMANCE OR ANY BENIFIT AT ALL. YOU WILL MAKE YOUR LIFE HELL IN THE NEAR FUTURE.
Then you have to register the handler in your web container, i used undertow
https://github.com/GedMarc/GuicedRestServices/commit/278127f1a3f4d8bf4a013ec1104b68ce245edf7b#diff-fcf278d175642d1cc5e1b9a77080bf58R31
I truly hope you fight back, and i will never work with your company, even by gunpoint.
Closing this issue as per the above comment.