java org.slf.4j_java.lang.NoClassDefFoundError: org/slf4j/impl/Sta

异常:

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.数据库驱动包。

引用\[1\]、\[2\]和\[3\]中提到了相同的错误:java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory。这个错误通常是由于缺少slf4j库引起的。slf4j是一个日志框架,用于在Java应用程序中记录日志。在这种情况下,应用程序无法找到LoggerFactory类,这是由于缺少slf4j库所致。要解决这个问题,你需要确保在你的项目中包含了正确的slf4j库。你可以从官方网站或Maven中央仓库下载并添加slf4j库的依赖。确保你的项目的构建路径正确配置了这个库。这样,应用程序就能找到LoggerFactory类,并成功运行。 #### 引用[.reference_title] - *1* [java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4jLoggerFactory](https://blog.csdn.net/weixin_33690367/article/details/92237721)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [Exception in thread “main“ java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory](https://blog.csdn.net/qq_42025798/article/details/115873418)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory](https://blog.csdn.net/lenny_wants/article/details/121916891)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值