dubbox 报错 Failed to invoke the method findAll in the service

1. Errors that may be included

1. The database password is wrong
2. The database name is wrong
3. The database driver version is wrong


1. Incorrect database password

This one should be relatively simple, just modify the password in the database connection configuration file (usually the db.properties file), it shouldn't need to elaborate too much!

2. The database name is wrong

This one may also cause an error in the report title. Find the database name in the database connection configuration file db.properties, and modify it to the correct name!

3. Database driver version error

This error is the one that kills people. Usually it is not configured properly here that will cause dubbo to report an error. The solution is explained below, and a note is also made to facilitate future problems that can be viewed. Figure 3.1 below is the error page.

Error page

Figure 3.1 Error page

Let's explain it below:

First check the mysql version number, enter the command line window and enter mysql -uroot -p, press enter and enter the password to enter the database View mysql version number
. After seeing the version number, return to the code to view the version number of the database dependency in your configuration dependency file pom.xml Right, if not, enter the version number in your mysql, and save the automatic update dependency after modification.
Note: If your version number is above 8.0, the database address in your database connection configuration file db.properties needs to be modified to:

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/xxx(此处填你的数据库名)?serverTimezone=UTC&characterEncoding=utf-8&useSSL=false
jdbc.username=root
jdbc.password=***(数据库密码)

Finally, finally! ! ! Must pay attention


After the modification, you must remember to run the dao layer project file through the install method of maven to update the modification of the database file. I just didn't do it here. I have not been able to find the reason. Now it is enough to think about it! So I am writing this blog to remind myself that I don’t usually write much, and suddenly I have this idea. It seems that I will write more in the future!

Okay, let’s write so much first, I hope to solve your problem~

Guess you like

Origin blog.csdn.net/weixin_42770603/article/details/107925706