From user-return-185143-apmail-struts-user-archive=struts.apache.org@struts.apache.org Mon Apr 07 16:11:02 2008 Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 43663 invoked from network); 7 Apr 2008 16:11:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Apr 2008 16:11:01 -0000 Received: (qmail 97197 invoked by uid 500); 7 Apr 2008 16:10:53 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 97174 invoked by uid 500); 7 Apr 2008 16:10:53 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 97163 invoked by uid 99); 7 Apr 2008 16:10:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 09:10:53 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [130.39.186.30] (HELO egate001.lsu.edu) (130.39.186.30) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 16:10:00 +0000 Received: from email002.lsu.edu ([130.39.186.37]) by egate001.lsu.edu with Microsoft SMTPSVC(6.0.3790.1830); Mon, 7 Apr 2008 11:10:18 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: interesting proxy + action chain issue Date: Mon, 7 Apr 2008 11:09:36 -0500 Message-ID: <1D5C148F9259BC47BC3CBD2F76ABA205E4E591@email002.lsu.edu> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: interesting proxy + action chain issue Thread-Index: AciYycaaEIoF0AYtQBeXmOMeHMfALw== From: "Brad A Cupit" To: X-OriginalArrivalTime: 07 Apr 2008 16:10:18.0598 (UTC) FILETIME=[DF859060:01C898C9] X-Virus-Checked: Checked by ClamAV on apache.org Hi! I'm having a very interesting issue with CGLIB proxies. I'm proxying my actions with Spring AOP (to get declarative transactions on each Action). Everything is working great, except when I try action chaining, I get a class cast exception that Action2 can't be cast to Action1 (Action1 is first in the chain). This was very unusual, so I investigated. Here's what I found: OgnlUtil.copy() is calling all of the getters in Action1 and pumping that data into setters on Action2. With CGLIB, it calls getCallbacks() and setCallbacks(), two methods created by CGLIB. This results in Action2 having Action1's callbacks. Basically, it's similar to the Action2 proxy referencing the Action1 target! I can't use JDK proxies because the getters on my action (whose values will be part of the value stack) are not defined on any interfaces, so reflection on a JDK proxy will not find those getters. I have a few ideas for workarounds, but I'd like to ask: has anyone else seen this? Am I the first to try CGLIB proxies and Action chaining? I've also read that action chaining is discouraged, but I don't understand why. Maybe a completely different approach would work better? Thanks! Brad Cupit Louisiana State University - UIS --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org