关于sping的xmlBeanFactory问题
我刚学sping的一个程序
总是说source not found the souce not contain the source for file XmlBeanDefinitionReader.class
源程序src/spring2/spingDemo.class
package spring2;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.core.io.*;
public class SpringDemo {
public static void main(String[] args)
{
Resource resource=new FileSystemResource("benas-config.xml");
BeanFactory factory=new XmlBeanFactory(resource);
HelloBean hello=(HelloBean)factory.getBean("helloBean");
System.out.println(hello.getHelloWord());
}
}
src/spring2/HelloBean.class
package spring2;
public class HelloBean {
private String helloWord;
public void setHelloWord(String helloword)
{
this.helloWord=helloWord;
}
public String getHelloWord()
{
return helloWord;
}
}
beans-config.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-2.0.xsd">
<bean id="helloBean" class="spring2.HelloBean">
<property name="helloWord">
<value>hello</value>
</property>
</bean></beans>
这是什么问题?
问题补充
这是debug下的 异常
XmlBeanDefinitionReader.loadBeanDefinitions(EncodedResource) line: 353
XmlBeanDefinitionReader.loadBeanDefinitions(Resource) line: 310
XmlBeanFactory.<init>(Resource, BeanFactory) line: 73
XmlBeanFactory.<init>(Resource) line: 61
SpringDemo.main(String[]) line: 9