Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

若配置好环境后运行仍抛出异常, 请参考此方法 #15

Open
GoogTech opened this issue Jun 25, 2020 · 13 comments
Open

若配置好环境后运行仍抛出异常, 请参考此方法 #15

GoogTech opened this issue Jun 25, 2020 · 13 comments
Labels
bug Something isn't working

Comments

@GoogTech
Copy link
Owner

GoogTech commented Jun 25, 2020

第一个错误分析

  1. 下载项目后,打开idea( 我的是2019.2 ),点击 open 打开该项目,等 maven 下载完毕 jar 包后即可配置Tomact
  2. 然后点击运行时会抛出异常,并且在 applicationContext.xml 文件中会有这三处爆红,如下图所示 :

原因 : 无法加载相应的配置文件,即没有找到指定的配置文件

解决办法 : 将 resource 文件重命名为 resources 并将 resources 下的文件都设置为 resources root 类型,除了 mapper 文件夹哟( 设置办法 : 右击 resources 文件夹 ---> Mark Directory as ---> resources root )

知识扩展 : idea中文件夹的分类

image
image

第二个错误分析

第一个常见错误解决了,若运行后还会报错那应该就是数据库的问题了,错误信息及解决方法如下所示:
image

注意数据库的版本,若 mysql 版本低于 8 的话就要修改代码中的数据库配置信息哟

  1. 修改数据库配置信息 : 先逐个复制表结构和语句,去掉编码部分( 我的mysql是5.0.51 ). 首先打开数据库配置文件 c3p0.properties 将 com.mysql.cj.jdbc.Driver 改为 com.mysql.jdbc.Driver

  2. 更新 pom.xml 文件中的 mysql-connector-java 版本
    并在下面加上

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.0.5< version>
</dependency>

第三个错误分析

一和二问题解决后就可以成功地运行该项目了,但是会发现使用名为 黄宇辉 的账户信息登录时会无法登录 ! 这是因为中文乱码的问题,自行在相应数据表中使用英文字母新建用户信息后,重新登录即可.

it's so embarrassed that this project had a lot of bugs but thanks for your issue and solution : @2938543506@qq.com

@GoogTech GoogTech added the bug Something isn't working label Jun 25, 2020
@GoogTech GoogTech pinned this issue Jun 25, 2020
@GoogTech GoogTech changed the title if you want to run the project successfully please refer to this issue how to run it successfully Aug 20, 2020
@GoogTech GoogTech changed the title how to run it successfully 若配置好环境后运行仍抛出异常, 请参考此解决方法 Jan 2, 2022
@GoogTech GoogTech changed the title 若配置好环境后运行仍抛出异常, 请参考此解决方法 若配置好环境后运行仍抛出异常, 请参考此方法 Jan 2, 2022
@emanresu112358
Copy link

修改了tb_admin表里面的数据,运行登陆弹出“登陆失败!服务器发生异常”,这个怎么解决呀?

@GuiterBoy
Copy link

GuiterBoy commented Jun 11, 2022 via email

@emanresu112358
Copy link

数据库是链接成功
截屏2022-06-11 22 39 14

@emanresu112358
Copy link

我的环境是macOS,我是不是路径错了啊。。。

@GuiterBoy
Copy link

GuiterBoy commented Jun 11, 2022 via email

@emanresu112358
Copy link

配置文件已经改好了
截屏2022-06-11 22 49 10

@emanresu112358
Copy link

晚安好梦

@GuiterBoy
Copy link

GuiterBoy commented Jun 11, 2022 via email

@GuiterBoy
Copy link

GuiterBoy commented Jun 11, 2022 via email

@emanresu112358
Copy link

对的,数据库是Studentss

@emanresu112358
Copy link

终于复现了,是一个十分值得学习的项目。

@NCHU-ZJJ
Copy link

NCHU-ZJJ commented Jul 8, 2023

终于复现了,是一个十分值得学习的项目。
请问你是如何解决
运行登陆弹出“登陆失败!服务器发生异常”这个问题的

@kk123m
Copy link

kk123m commented May 7, 2024

显示url错误是什么原因啊,打不开网页

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants