Thanks Paul,
I had looked at that bug prior to posting here, it is slightly different to my problem in that it states that the injected parameter is null, where as I get a defined exception on startup telling me about the request scope problem. Hopefully the two are related and the one fix will address both problems.
I wish I had the time and enough knowledge of Jersey internals to find the issue myself, but in digging through the source I'm yet to unravel exactly how HK2 is being used....
The date for 2.3 is earmarked for 29 September, but the Jira issues hasn't had any work logged against it yet... I hope it will still get done in time and that the release is as predicted. Is the Jersey team fairly good at hitting their release dates?
Thanks for the follow up.
Thanks
Chris
From: Paul Moore [mailto:paulkmoore_at_gmail.com]
Sent: Tuesday, 10 September 2013 5:47 PM
To: users_at_jersey.java.net
Subject: [Jersey] Re: Not inside request scope in a ContainerRequestFilter
Hi Chris,
https://java.net/jira/browse/JERSEY-1960 might be of interest. It's chalked for 2.3.
Best
Paul
On Tuesday, September 10, 2013, Chris Wright wrote:
Further to this, I get the same error when trying to inject HttpServletRequest into a ContainerRequestFilter... have I configured something wrong... everything I look out seems to indicate that this should work?
@Context
HttpServletRequest request;
Thanks
Chris
From: Chris Wright
Sent: Tuesday, 10 September 2013 10:40 AM
To: 'users_at_jersey.java.net<javascript:_e(%7b%7d,%20'cvml',%20'users_at_jersey.java.net');>'
Subject: Not inside request scope in a ContainerRequestFilter
Hi all,
I am having trouble getting Jersey 2.2 to inject a request scope injectable into a ContainerRequestFilter. The injectable works fine when injected into a resource, but I can't inject it into a Filter - it seems to me that this should be allowed am I missing something?
The exception is:
javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-483429798_at_2f4865c==org.glassfish.jersey.servlet.ServletContainer,-1,false<mailto:org.glassfish.jersey.servlet.ServletContainer-483429798_at_2f4865c==org.glassfish.jersey.servlet.ServletContainer,-1,false>
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:563)
at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:351)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:800)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:288)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:731)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:108)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
at org.eclipse.jetty.util.component.AbstractLifeCyc