본문 바로가기
OpenSource/Spring MVC

org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class

by 태하팍 2013. 6. 10.
반응형

 

<tx:annotation-driven proxy-target-class="true" transaction-manager="transactionManager"/>

설정 시 아래와 같은 오류가 났다..

 

Could not autowire field: com.kt.guide.board.facade.BoardFacade com.kt.guide.board.controller.BoardController.boardFacade; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'boardFacade': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.kt.guide.board.service.BoardService com.kt.guide.board.facade.BoardFacade.boardService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'boardService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.kt.guide.board.dao.pna.BoardDao com.kt.guide.board.service.BoardService.boardDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'boardDao': Post-processing of the FactoryBean's object failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class[class $Proxy217]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy217
 at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:213)

 

class proxy를 사용 할 시 제약 조건 중에 final class를 사용하면 안된다는 것이 있는데..

어디에선가..사용을 하고 있는 것 같다.

 

그래서 결론적으로! 주의사항으로 콘크리트기반(POJO)일 때는 aop의 포인트컷 표현식에서 범위를 짧게 주어 final class가 걸리지 않도록 해주어야 한다.

 

                      - END -

반응형