Following the excellent step-by-step given in Up and running on AppEngine with Maven, Jersey and Guice - Part 3, I have been able to get everything working except injecting objects into a Jersey POJO.
The only difference I have from that configuration is that I also have Objectify integrated, but that is working.
The TestClass
instance (a singleton) injected into HelloWorldServlet
works, but the TestClass
and SecondTest
(RequestScoped
) objects injected into the HeyResource
POJO are always null
.
I suspect the the interaction between HK2 and Guice is to blame here, but this is my first project with Guice and Jersey and HK2, so I am all at sea.
My configuration is:
- Platform: Win 7
- GAE SDK 1.9.26
- Jave 1.7.0_79
- Jersey: 2.5.1
- Guice: 4.0
- Objectify: 5.1.7
- HK2 Guice-bridge: 2.2.0
- Maven 3.3.3