在写beanAnnotation时的问题
<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd" >
<context:component-scan base-package="main.java.beanAnnotation"></context:component-scan>
</beans>
package main.java.beanAnnotation;
import org.springframework.stereotype.Component;
@Component
public class BeanAnnotation {
public void say(String word){
System.out.println("Annotation"+word+this.hashCode());
}
}
import test.ioc.base.UnitTestBase;
public class TestBeanAnnotation extends UnitTestBase{
public TestBeanAnnotation(){
super("classpath:Spring-beanscope.xml");
}
@Test
public void testAnnotation(){
BeanAnnotation test=super.getBean("beanAnnotation");
test.say("第一个bean啊");
}
}
代码如上,报错:Unexpected exception parsing XML document from class path resource [Spring-beanscope.xml];
求解答