java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

项目登录不上

img

点击登录没反应,(如果密码、验证码错误会弹出报错窗口)
1 运行结果:


uname===================================张三
Creating a new SqlSession
Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@298b54e9]
JDBC Connection [com.mysql.jdbc.JDBC4Connection@10fb3b20] will be managed by Spring
==>  Preparing: select * from tab_user where uname=? 
==> Parameters: 张三(String)
Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@298b54e9]
Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@298b54e9]
Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@298b54e9]

2 tomcat日志报错:

### Error querying database.  Cause: java.sql.SQLException: Error
### The error may exist in com/tao100/dao/UserDao.java (best guess)
### The error may involve com.tao100.dao.UserDao.getOneByUname-Inline
### The error occurred while setting parameters
### SQL: select * from tab_user where uname=?
### Cause: java.sql.SQLException: Error
; uncategorized SQLException; SQL state [null]; error code [0]; Error; nested exception is java.sql.SQLException: Error] with root cause
 java.lang.ClassNotFoundException: org.slf4j.LoggerFactory

3 这一行执行不了:

img

(我的项目是这个错,从别人那里复制整个项目也是这个错)

这不是说了么

img

你的sql有问题,跟日志有毛关系,sql报异常会写异常日志

The error occurred while setting parameters
出现此问题原因是sql语句没有问题,应该是映射配置异常,需要看一下sql配置文件信息进行定位.