public class doBeforeAdvice implements MethodInterceptor{ @Override public Object invoke(MethodInvocation arg0) throws Throwable { // TODO 自动生成的方法存根 System.out.println("之前"); Object o=arg0.proceed(); System.out.println("之后"); return o; } } 这是类代码 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> <bean id="helloSpring" class="com.entity.HelloSpring"> <property name="work" value="林冲"/> <property name="man" value="军人"/> </bean> <bean id="doBefor" class="com.entity.doBeforeAdvice"> </bean> <bean id="helloProxy" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="proxyInterfaces"> <value>Text</value> </property> <property name="target"> <ref bean="helloSpring"/> </property> <property name="interceptorNames"> <list> <value> doBefor </value> </list> </property> </bean> </beans> 这是XML配置文件 |
|
40分 |
Failed to convert property value of type [java.lang.String] to required type [java.lang.Class[]] for property “”proxyInterfaces””;
他说你这是类型转换错误了吧。你仔细看看你的代码是不是哪里用错了? |