users@jersey.java.net

[Jersey] init params are not passed to a custom ResourceConfig - jersey 2.9

From: Sameer Shah <ssameer_at_yahoo-inc.com>
Date: Thu, 19 Jun 2014 23:19:01 +0000

Hi,

I am trying to dynamically setup the jersey ServletContainer. I am extending the ResourceConfig and passing the class name as init parameters “ServletProperties.JAXRS_APPLICATION_CLASS". Along with these initParameters, there are some other params I am passing as well, which I intend to read from the ResourceConfig. (I need these parameters to bind a singleton using HK2).

When I initialize the servlet I see that the resourceConfig is created but the initParameters are not passed to my ResourceConfig. While debugging through this, I found that internally the WebComponent creates the WrappingResourceConfig and also passes the initParam to it. But these init params are never added to my resourceConfig implementation.

Is this the intended behavior? Please guide me if this is not how it is intended to achieve what I am trying.

Thanks,

Sameer