java.lang.ClassNotFoundException: org.slf4j.LoggerFactory异常处理

当启动tomcat后,在控制台出现如下提示:

org.springframework.beans.factory.BeanCreationException: 

Error creating bean with name 'sessionFactory' defined in ServletContext resource 

[/WEB-INF/hib-config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: 

Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Constructor threw exception; 

nested exception is java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory


这种情况,一般是在lib包下缺少两个jar文件,这两个jar文件是:slf4j-api-1.5.0和slf4j-log4j12-1.5.0,他们的位置在:

spring-framework-2.5.6\lib\slf4j文件夹下。

你可能感兴趣的:(springMVC异常处理)