Ace-T's Blog 내 검색 [네이버 커넥트 이웃 합니다~^-^/ 요청 大 환영~~]

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

OpenSource/Spring MVC 2013.06.10 11:05
[Good Comment!!, Good Discussion!!, Good Contens!!]
[ If you think that is useful, please click the finger on the bottom~^-^good~ ]
by ace-T

 

<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 -

acet 박태하가 추천하는 readtrend 추천글!

설정

트랙백

댓글

:::: facebook을 이용하시는 분들은 로그인 후 아래에 코멘트를 남겨주세요 ::::

티스토리 툴바