Spring +Struts + Hibernate + MySQL碰到的几个问题

小结

配置Spring +Struts + Hibernate + MySQL碰到的几个问题,并解决。

问题及解决

访问MySQL数据库的问题

返回错误:java.sql.SQLException: Access denied for user 'root '@‘localhost’ (using password: YES)

发现MySQL没有开放远程访问权限,解决:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';

对于MariaDB修改密码需要以下指令:

UPDATE user SET authentication_string=password('P@ssw0rd') WHERE user='root'

缺少jar包

返回错误:Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]

缺少struts2-spring-plugin-x.x.x.x.jar包,添加到工程里就行。

地址已经被占用

返回: java.net.BindException: Address already in use: JVM_Bind :80

需要找到进程,并关掉进程,就不会冲突了。

netstat -oan | find "80"
taskkill /F /PID xxxx

参考

Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
java.net.BindException: Address already in use: JVM_Bind :80
MySQL Error: : 'Access denied for user ‘root’@‘localhost’
解决无法获取数据库连接 java.sql.SQLException: Connections could not be acquired from the underlying database

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值