I'm having an issue retrieving servlet parameters with a springmvc resteasy setup using 2.3.5.Final. A class that I have no control over uses the @Context to inject the ServletConfig so that it can look up an init-param. When this class asks the injected context for the param an exception is thrown saying
org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data of type: javax.servlet.ServletContext
Digging in a little further showed that its a proxy for the ServletContext gets injected into the class; a ContextParameterInjector$GenericDelegatingProxy specifically. When the 'getInitParameter' method is called on the proxy, it calls to the to the ResteasyProviderFactory to retrieve the ServletContext. This context is missing and so the above exception gets thrown.
From what I can tell, it seems that the deploment gets configured differently using springmvc-resteasy.xml than it otherwise might with the plain ResteasyBootstrap. I'm thinking it boils down the the init method in the ServletContainerDispatcher, if the app is bootstrapped outside of spring it causes the following code to be run
And this makes the ServletContext available via the provider factory and subsequently for injection. When spring initializes the deployment the other path is taken and this is not called.
I've condensed down my config into a simple maven based example to illustrate. I'll happily provide any extra info that might be required to help troubleshoot.