Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 21480 invoked from network); 11 Jun 2008 13:13:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2008 13:13:46 -0000 Received: (qmail 67548 invoked by uid 500); 11 Jun 2008 13:13:49 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 67531 invoked by uid 500); 11 Jun 2008 13:13:49 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 67520 invoked by uid 99); 11 Jun 2008 13:13:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 06:13:49 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 13:12:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 00593234C137 for ; Wed, 11 Jun 2008 06:12:45 -0700 (PDT) Message-ID: <620322290.1213189965000.JavaMail.jira@brutus> Date: Wed, 11 Jun 2008 06:12:45 -0700 (PDT) From: "Andreas Benneke (JIRA)" To: issues@cxf.apache.org Subject: [jira] Updated: (CXF-1645) ResourceInjector fails to inject into (Spring) proxies if resource to be in injected is subclassed In-Reply-To: <980238715.1213189725027.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-1645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andreas Benneke updated CXF-1645: --------------------------------- Attachment: ResourceInjector.patch This patch adds the proposed change to the ResourceInjector and extends the unit test to cover the specified case . (Note: the test fails with the unpatched ResourceInjector) > ResourceInjector fails to inject into (Spring) proxies if resource to be in injected is subclassed > -------------------------------------------------------------------------------------------------- > > Key: CXF-1645 > URL: https://issues.apache.org/jira/browse/CXF-1645 > Project: CXF > Issue Type: Bug > Components: Core > Affects Versions: 2.1, 2.0.6, 2.1.1, 2.0.7 > Reporter: Andreas Benneke > Attachments: ResourceInjector.patch > > > If the target is a proxy ResourceInjector tries to resolve an appropriate setter method for the resource using > Method targetMethod = getTarget().getClass().getMethod(method.getName(), new Class[]{resource.getClass()}); > targetMethod.invoke(getTarget(), resource); > This fails if the resource has been subclassed because getMethod() (still) does only exact matches (see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4287725). > This is (for example) the reason why injecting the WebServiceContext into a (Spring) proxy does not work: The real implementation WebServiceContextImpl is always a subclass (see thread http://www.mail-archive.com/cxf-user@incubator.apache.org/msg03050.html) > As a solutions, the ResourceInjector might implement it's own matching algorithm or e. g. use Spring's MethodInvoker instead which already contains such an algorithm: > MethodInvoker targetInvoker = new MethodInvoker(); > targetInvoker.setTargetObject(getTarget()); > targetInvoker.setTargetMethod(method.getName()); > targetInvoker.setArguments(new Object[]{resource}); > targetInvoker.prepare(); > targetInvoker.invoke(); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.