ref local spring error - 스프링실무교육학원
스프링 설정 XML파일 헤더에 아래와 같이 spring-beans.xsd로 설정된 경우 <ref local="XXX"/> 형태로 사용하면 local 속성이 없으므로 오류가 발생한다.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context <context:component-scan">http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<context:component-scan base-package="edu.biz.ioc4"/>
</beans>
다음처럼 spring-beans.xsd 를 spring-beans-3.2.xsd 형태로 수정하자.
Spring4 이상에서는 <ref local = ... /> 보다는<ref bean= ... />을 사용하면 된다.
[출처] 오라클자바커뮤니티 - http://ojc.asia/bbs/board.php?bo_table=LecSpring&wr_id=494
댓글 없음:
댓글 쓰기