补充一下代码
public class SpringTest
{
public static void main(String[] args) throws IOException
{
InputStream is = new FileInputStream("bean.xml");
BeanFactory factory = new XmlBeanFactory(is);
//此处出错,抛出异常
//java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
System.out.println("ok");
HelloBean hello = (HelloBean) factory.getBean("helloBean");
System.out.println(hello.getHelloWord());
}
}
public class SpringTest
{
public static void main(String[] args) throws IOException
{
InputStream is = new FileInputStream("bean.xml");
BeanFactory factory = new XmlBeanFactory(is);
//此处出错,抛出异常
//java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
System.out.println("ok");
HelloBean hello = (HelloBean) factory.getBean("helloBean");
System.out.println(hello.getHelloWord());
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货