Return-Path: X-Original-To: apmail-incubator-amber-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-amber-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 43AB7C65D for ; Sat, 12 May 2012 09:36:16 +0000 (UTC) Received: (qmail 23119 invoked by uid 500); 12 May 2012 09:36:16 -0000 Delivered-To: apmail-incubator-amber-dev-archive@incubator.apache.org Received: (qmail 22979 invoked by uid 500); 12 May 2012 09:36:12 -0000 Mailing-List: contact amber-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: amber-dev@incubator.apache.org Delivered-To: mailing list amber-dev@incubator.apache.org Received: (qmail 22922 invoked by uid 99); 12 May 2012 09:36:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 May 2012 09:36:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 May 2012 09:36:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 92657492413 for ; Sat, 12 May 2012 09:35:49 +0000 (UTC) Date: Sat, 12 May 2012 09:35:49 +0000 (UTC) From: "Jan Petertonkoker (JIRA)" To: amber-dev@incubator.apache.org Message-ID: <1963527484.57858.1336815349601.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <899270751.385.1333372765007.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AMBER-51) Guice+Jersey+Amber: Can't correctly create OAuthTokenRequest instance MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMBER-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13273906#comment-13273906 ] Jan Petertonkoker commented on AMBER-51: ---------------------------------------- Thanks for your workaround! I had the same issue using Jersey 1.12 and amber 0.22-incubating-SNAPSHOT. > Guice+Jersey+Amber: Can't correctly create OAuthTokenRequest instance > --------------------------------------------------------------------- > > Key: AMBER-51 > URL: https://issues.apache.org/jira/browse/AMBER-51 > Project: Amber > Issue Type: Bug > Environment: jersey 1.10 > guice 3.0-SNAPSHOT > amber 0.22-incubating-SNAPSHOT > Reporter: Alexander Urmuzov > > I've got a problem with creating OAuthTokenRequest. > It needs an instance of HttpServletRequest on creation, but all instances which I can get through guice or jersey injections have no post parameters. > Guice injection example: > private final Provider requestProvider; > @Inject > public TokenEndpoint(Provider requestProvider) { > this.requestProvider = requestProvider; > } > @POST > @Consumes(MediaType.APPLICATION_FORM_URLENCODED) > @Produces(MediaType.APPLICATION_JSON) > public Response authorize() throws OAuthSystemException { > OAuthTokenRequest oauthRequest = null; > try { > oauthRequest = new OAuthTokenRequest(requestProvider.get()); > .... > Jersey injection example: > @POST > @Consumes(MediaType.APPLICATION_FORM_URLENCODED) > @Produces(MediaType.APPLICATION_JSON) > public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException { > OAuthTokenRequest oauthRequest = null; > try { > oauthRequest = new OAuthTokenRequest(request); > Looks like jersey have parsed HttpServletRequest and removed all post parameters from it. > If I attach filter that tries to get some parameter from HttpServletRequest before jersey, my code works, but with exception from jersey. > But I can retrieve MultivaluedMap of post parameters from jersey with all data and no errors. > I think there must be some alternative constructor for such environments. Any thoughts? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira