2013-08-16 4 views
1

를 포인트 컷에> 클래스 명 <에서 형식을 변환 할 수 없습니다. 나는 aop-config.xml에 다음있어 :스프링 AOP는 : 나는 스프링 MVC 웹 응용 프로그램에서 일하고 있어요 그리고 특정 방법에 대한 AOP 래퍼를 설정하기 위해 노력하고있어

<bean name="callCatcher" class="com.business.project.aop.callCatcher"/> 

<aop:config proxy-target-class="true"> 
    <aop:pointcut expression="execution(* com.business.project.util.className.methodName(..))" id="catchCall"/> 
    <aop:advisor advice-ref="callCatcher" pointcut-ref="catchCall"/> 
</aop:config> 

proxy-target-class="true"는 그 제안했지만 내 상황에 아무것도 할 것 같다하지 않는 경우 SO 여기에 비슷한 질문을 찾은 후 추가되었습니다.

aop-config.xml

가 포함되어 내 servlet-config.xml :

Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.business.project.util.className' to required type 'org.springframework.aop.Pointcut' for property 'pointcut'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.business.project.util.className] to required type [org.springframework.aop.Pointcut] for property 'pointcut': no matching editors or conversion strategy found 
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:463) 
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494) 
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:488) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1433) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1392) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128) 
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
    ... 37 more 

내가 가로 채려고 클래스가되고있다 : 나는 다음과 같은 예외를 받고있어이를 배포하려고

<import resource="aop-config.xml"/> 

그것을 사용하고있는 클래스의 속성으로 자동 배선되었습니다. 그래서 문제의 일부인지 궁금합니다. 너무 특별하지 않아요.

public class className implements ApplicationContextAware {...} 

내가 가로 채고 자하는 방법은 공개입니다.

나는 포함 다른 모르겠어요. 나는 예외를 봤어, 프록시, pointcut 표현을 확인. 어떤 도움이라도 대단히 감사 할 것입니다.

편집 :

나는 프로젝트의 담쟁이 구성 CGLIB를 포함하고 다음과 같이 AOP-설정을 설정 :

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:aop="http://www.springframework.org/schema/aop" 
     xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.2.xsd 
     http://www.springframework.org/schema/aop 
     http://www.springframework.org/schema/aop/spring-aop-3.2.xsd"> 

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

    <bean name="callCatcher" class="com.business.project.aop.EditorActionLogger"/> 

    <aop:config proxy-target-class="true"> 
     <aop:pointcut expression="execution(* com.business.project.util.className.methodNAme(..))" id="callCatcher"/> 
     <aop:advisor advice-ref="editorActionLogger" pointcut-ref="timeslotReloader"/> 
    </aop:config> 
</beans> 

아직도 같은 예외를 받고.

+0

클래스 이름을 AOP를 사용하려면 콩 같은 맥락에있는 것으로 서블릿-config.xml에하지 AOP-config.xml 파일에

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

을 넣어 생각 cglib 사용 하시겠습니까? – Reimeus

+0

나는 정말로 ... 모르겠다. 나는 그렇게 생각하지 않는다. 우리는 의존성 관리를 위해 Ivy를 사용하고 config 파일을 검사했고 cglib에 대해서는 아무 것도 볼 수 없었습니다. – JDiPierro

+0

'Spring'보다는 cglib 프록시를 강요하면 괜찮을 것입니다. 담쟁이에 대한 의존성을 추가 할 수 있습니까? (여기를보십시오) (http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.net.sf.cglib&version=2.2.0)? – Reimeus

답변

2

사람 나는 당신이 당신은 당신이 그것에

+0

aop-config를 서블릿으로 가져옵니다. -config와 함께 :''. 내가 서블릿 config에 직접 넣어 보도록하겠습니다. 작동하는지 알려 드리겠습니다. – JDiPierro

관련 문제