HK2 Factory invoked prior to Jersey filter when @Context is used for setter/field/constructor injection
问题 I've been able to inject into my jersey resource from a filter as per How to inject an object into jersey request context?. This allows me to successfully inject into a method parameter: @GET public Response getTest(@Context MyObject myObject) { // this works However, for setter/field/constructor injection, the HK2 Factory is invoked before the jersey filter, which means the provide() method returns null: @Override public MyObject provide() { // returns null because the filter has not yet run