Try using CGLIB proxies rather than Dynamic JDK proxies... I'm
guessing that your methods are not defined in one of the extended
interfaces. Assuming you are using Spring 2.5 or higher, try adding
this to your applicationContext.xml ->

<aop:config proxy-target-class="true" />

Then make sure you have the CGLIB jars available. You also have to
make sure that you have the AOP namespace available... make sure your
<beans /> tag has the following -

<beans
...
    xmlns:aop="http://www.springframework.org/schema/aop";
    xsi:schemaLocation="
...
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.0.xsd";>

It's sort of just a stab, but it seems like whenever I run into a
problem that Spring is not finding methods defined on the bean, I have
to change the proxy type to fix it... Dynamic JDK proxies only expose
methods that are defined as part of an implemented interface, CGLIB
can expose all of the methods, but the downside is that you must have
a no-arg constructor for the bean being proxied... For Struts2
actions, that probably isn't a big deal.

-Wes

On Wed, Feb 18, 2009 at 10:10 AM, Sundararaman, Anand
<anand.sundarara...@ps.net> wrote:
> Hi Dale and Wes,
>
>  I am the original poster. But I did get a lot of information in this 
> discussion.
>
> I will like to explain my original issue again.
>
> In my Struts2- Spring2 application, I had configured the struts2-Spring 
> plugin and made Spring initialize all the action classes etc. Basically I 
> configured all the action classes in the applicationContext.xml and all the 
> action classes scoped prototype. But when I try to invoke the non-execute 
> (do*) methods from my screen actions, it was failing with 
> NoSuchMethodException. If I change the scope to singleton it was working 
> fine. But I need the action classes to be prototype for thread safety. So I 
> need a solution for having the action classes scoped prototype and also able 
> to use the non-execute methods. Then I was interested to see if I make the 
> Struts load the action classes, but Spring load the service,DAO etc. and if I 
> can wire them up.
>
> Please let me know if you have better ideas.
>
> Thanks a Lot,
> Anand
>
>
> -----Original Message-----
> From: Dale Newfield [mailto:d...@newfield.org]
> Sent: Tuesday, February 17, 2009 7:08 PM
> To: Struts Users Mailing List
> Subject: Re: Struts2-Spring Integration Issue
>
> Wes Wannemacher wrote:
>> I jumped into the thread late and didn't see your original problems. I tend 
>> to
>> peruse for things I can help on, so I'm not sure if I have an answer for your
>> original problem :(
>
> I wasn't the original poster.  I don't think I ever saw the original
> message, so let's hope that that person has resolved his or her issue.
> :-)  If not, please remind us of what it was!  (I'm like you--I don't
> have time to read the full list these days, so I look for messages with
> subject lines on which I might be able to offer advice--in this case I
> took an interest in a thread for selfish reasons rather than helpful ones.)
>
>> Although, there are a few considerations for interceptors and their
>> dependencies (as opposed to actions), especially when dealing with databases.
>> Mainly, an interceptor is a singleton, so, if you are grabbing a resource via
>> spring, and that resource depends on a database resource, could a pool or
>> something be re-claiming it after excessive idle time?
>
> Those are good suggestions--when I do get time to re-focus on this
> problem I'll investigate that angle -- it may well be something like that.
>
> Thanks,
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to