2013-06-05 5 views
0

동일한 프로젝트 내의 하나의 패키지에서 @Autowired을 사용하여 appcontext.xml에서 요소를 가져와 정상적으로 작동합니다. 동일한 appcontext에 정의 된 bean이 @Autowired이 되더라도 성공적으로 작성되지만 bean을 주입시키려는 시도는 없습니다.@Autowired가 하나의 패키지에서 발견되었지만 다른 패키지에서 발견되었습니다.

클래스 패스와 관련하여 뭔가 빠져있는 것처럼 느껴집니다. 지금, 나는 나의 appcontext에 <context:component-scan />를 추가하려고했습니다,하지만 그건 나만이 오류 제공 : 내 AppContext.xml의

org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.

부분 : 정의 된 콩

<?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:p="http://www.springframework.org/schema/p" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:context="http://www.springframework.org/schema/context/spring-context-2.5.xsd" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-2.5.xsd 
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> 

    <context:component-scan base-package="org.jasig.cas.web.flow"/> 

을 그 아래에.

눈에 띄는 결함이 있습니까? 아니면 변경해야하는 다른 구성이 있습니까?

답변

3

라인 xmlns:context="http://www.springframework.org/schema/context/spring-context-2.5.xsd" 단순히 xmlns:context="http://www.springframework.org/schema/context"

+0

감사해야합니다. 문제 해결을 위해 초기 경로를 많이 바꾸었고, 문제를 일으키는 개별 라인을 찾으려고 힘들었을 것입니다. –

관련 문제