Chris Kyrouac
2013-12-19 15:49:55 UTC
Hi, I am working on a group backend plugin that requires access to the
original HttpServletRequest object. I tried injecting both
HttpServletRequest and Provider<HttpServletRequest> into the group backend.
Either way I get a message saying, "No implementation for
javax.servlet.http.HttpServletRequest was bound.", in error_log when Gerrit
tries to load the plugin. I'm under the impression that guice-servlet
should have bound an implementation of HttpServletRequest. I see that
gerrit doesn't have the guiceFilter set in web.xml but I'm not sure if some
trickery is done in WebAppInitializer to create the necessary bindings.
I have also tried injecting CacheBasedWebSession similarly with no success.
When I first try to inject it into my group backend, RequestScoped was not
bound to an implementation. So, I bound it to
PerThreadRequestScope.REQUEST. Now I get four errors when trying to load
the plugin:
1) No implementation for com.google.common.cache.Cache<java.lang.String,
com.google.gerrit.httpd.WebSessionManager$Val> annotated with
@com.google.inject.name.Named(value=web_sessions) was bound
2) No implementation for java.net.SocketAddress annotated with
@com.google.gerrit.server.RemotePeer() was bound.
3) No implementation for javax.servlet.http.HttpServletRequest was bound.
4) No implementation for javax.servlet.http.HttpServletResponse was bound.
This is all with Gerrit 2.8 and v2.8 of plugin-api.jar.
Is there a way to get HttpServletRequest that I'm missing?
Thanks!
Chris
original HttpServletRequest object. I tried injecting both
HttpServletRequest and Provider<HttpServletRequest> into the group backend.
Either way I get a message saying, "No implementation for
javax.servlet.http.HttpServletRequest was bound.", in error_log when Gerrit
tries to load the plugin. I'm under the impression that guice-servlet
should have bound an implementation of HttpServletRequest. I see that
gerrit doesn't have the guiceFilter set in web.xml but I'm not sure if some
trickery is done in WebAppInitializer to create the necessary bindings.
I have also tried injecting CacheBasedWebSession similarly with no success.
When I first try to inject it into my group backend, RequestScoped was not
bound to an implementation. So, I bound it to
PerThreadRequestScope.REQUEST. Now I get four errors when trying to load
the plugin:
1) No implementation for com.google.common.cache.Cache<java.lang.String,
com.google.gerrit.httpd.WebSessionManager$Val> annotated with
@com.google.inject.name.Named(value=web_sessions) was bound
2) No implementation for java.net.SocketAddress annotated with
@com.google.gerrit.server.RemotePeer() was bound.
3) No implementation for javax.servlet.http.HttpServletRequest was bound.
4) No implementation for javax.servlet.http.HttpServletResponse was bound.
This is all with Gerrit 2.8 and v2.8 of plugin-api.jar.
Is there a way to get HttpServletRequest that I'm missing?
Thanks!
Chris
--
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
To unsubscribe, email repo-discuss+***@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.