异常:
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
root cause
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
org.hibernate.cfg.Configuration.(Configuration.java:152)
hibernatesession.HibernateSessionFactory.(HibernateSessionFactory.java:8)
member.MemberDAO.getSession(MemberDAO.java:10)
member.MemberDAO.save(MemberDAO.java:15)
org.apache.jsp.submit_jsp._jspService(submit_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
主要是因为缺少包slf4j-log4j12-1.5.8.jar,可在上下载。
异常:
java.lang.NoClassDefFoundError: org/apache/log4j/Level
root cause
java.lang.NoClassDefFoundError: org/apache/log4j/Level
org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
org.hibernate.cfg.Configuration.(Configuration.java:152)
hibernatesession.HibernateSessionFactory.(HibernateSessionFactory.java:8)
member.MemberDAO.getSession(MemberDAO.java:10)
member.MemberDAO.save(MemberDAO.java:15)
org.apache.jsp.submit_jsp._jspService(submit_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
缺少包:log4j-1.2.14.jar
Hibernate(3.3.2.GA)项目中应该导入的包有:
1.hibernate3.jar
2.分发包中,lib下的required目录下的所有包。
3.slf4j-log4j12-1.5.8.jar
4.log4j-1.2.14.jar
5.数据库驱动包。