使用spring 4.3.5和commons-logging运行项目时报以下错误,commons-logging的jar包也导入了还是报错。
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryat org.springframework.context.support.AbstractApplicationContext.(AbstractApplicationContext.java:161)at org.springframework.context.support.AbstractApplicationContext.(AbstractApplicationContext.java:225)at org.springframework.context.support.AbstractRefreshableApplicationContext.(AbstractRefreshableApplicationContext.java:88)at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.(AbstractRefreshableConfigApplicationContext.java:58)at org.springframework.context.support.AbstractXmlApplicationContext.(AbstractXmlApplicationContext.java:61)at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:136)at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)at com.spring.HelloMain.main(HelloMain.java:9)
后来发现是自定义user library时勾选了 systen library,把这个勾选去掉,即可运行