ClassPathXmlApplicationContext(String) 오류에 대해 질문드립니다.

조회수 1810회
package sia.knights;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class KnightMain {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("META-INF/spring/knight.xml");
        Knight knight = context.getBean(Knight.class);
        knight.embarkOnQuest();
        context.close();
    }
}

위 코드에서 new ClassPathXmlApplicationContext("META-INF/spring/knight.xml"); << 이 부분에 오류가 나네요.

Multiple markers at this line

    - The type org.springframework.beans.BeansException cannot be resolved. It is indirectly referenced from 
     required .class files
    - The constructor ClassPathXmlApplicationContext(String) refers to the missing type BeansException

라고 나옵니다ㅠㅠ 어떻게 하면 해결할 수 있을까요?

혹시 몰라 xml 파일도 첨부합니다.

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

        <bean id="knight" class="sia.knights.BraveKnight">
    <constructor-arg ref="quest" />
    </bean>
    <bean id="quest" class="sia.knights.SlayDragonQuest">

    </bean>
</beans>

  • (•́ ✖ •̀)
    알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)