On Sat, 2009-01-03 at 00:15 +0100, Lukasz Lenart wrote:
> 2009/1/2 Musachy Barroso <[email protected]>:
> > That code is a "fallback" to create an instance using a default
> > constructor, when a UnsatisfiedDependencyException is thrown from
> > spring. Take a look at SpringObjectFactory line 162. Something is
> > wrong in your spring mapping (the "employeeManager" bean maybe?)
> 
> I think I found the problem, I'm using AOP for transactions and have
> such config for employeeManager
> 
>     <bean id="employeeManagerTarget"
> class="pl.org.lenart.ems.managers.impl.EmployeeManagerImpl">
>         <constructor-arg ref="employeeDao"/>
>     </bean>
> 
>     <bean id="employeeManager"
> class="org.springframework.aop.framework.ProxyFactoryBean">
>         <property name="proxyInterfaces"
> value="pl.org.lenart.ems.managers.EmployeeManager"/>
>         <property name="target" ref="employeeManagerTarget"/>
>     </bean>
> 
> and as I noticed, Struts2 right now use by default constructor base
> autowiring and Spring found two matching params for EmployeeAction
> constructor - employeeManager and employeeManagerTarget. Looks like
> Spring issue...
> 

Lukasz, it may be unrelated, but I vaguely remember having a similar
issue a while back and switching to cglib based proxies because JDK
interface proxies didn't seem to cut it. IIRC, all I had to do was add
cglib to the classpath and add proxy-target-class="true" to the
<aop:config section of my applicationContext.xml file.

I have a sample app up here - 
http://code.google.com/p/struts2inpractice/source/browse/#svn/trunk/ch02ex01

It may be different than what your doing. None of the apps up there use
AOP with conventions (yet!).

-Wes


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to