No sir. I need an object but my object has a constructor that takes a parameter of certain type. I have a doubt that the proxy bean factory does not create an object that has a constructor. What i need to be proxied is an object that takes parameter of a certain type. 
Take a look at my bean config:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="SpringCustomer" class="arnel.nicolas.Customer">
<property name="firstname">
<value>Arnel</value>
</property>
<property name="lastname">
<value>Nicolas</value>
</property>
</bean>
<bean id="BankTarget" class="arnel.nicolas.Bank">
<constructor-arg index="0">
<ref bean="SpringCustomer"/>
</constructor-arg>
</bean>
<bean id="WithDrawalAdvice" class="arnel.nicolas.BeforeWithdrawal"/>
<bean id="BankPointCutAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
<property name="advice">
<ref bean="WithDrawalAdvice"/>
</property>
<property name="mappedName">
<value>withdrawMoney</value>
</property>
</bean>
<bean id="Bank" class="org.springframework.aop.framework.ProxyFactoryBean">
<constructor-arg index="0">
<ref bean="SpringCustomer"/>
</constructor-arg>
<property name="proxyInterfaces">
<value>arnel.nicolas.IBank</value>
</property>
<property name="proxyTargetClass">
<value>true</value>
</property>
<property name="target">
<ref bean="BankTarget"/>
</property>
<property name="interceptorNames">
<list>
<value>BankPointCutAdvisor</value>
</list>
</property>
</bean>
</beans>
This is my java code:
Code:
........
import org.springframework.context.*;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.aop.framework.ProxyFactoryBean;
public class SpringBreakMain {
public static void main(String [] args) {
ApplicationContext context = new FileSystemXmlApplicationContext("D:\\SpringBreak\\src\\SpringBreak.xml");
(Bank) bank =(Bank)context.getBean("Bank");
bank.withdrawMoney(2500);
}
}
[/code]
Now if i run the code it spits-out this error:
Code:
....................... 1 constructor arguments specified but no matching constructor found in bean 'Bank' (hint: specify index arguments for simple parameters to avoid type ambiguities.