What about the phenomenon of trying to connect to an IP that is not specified even when the spring jdbc DB connection is configured?

Viewed 23

While I was working on a project written in Spring Framework, I saw a strange phenomenon.

I took over two spring projects from my predecessor.

Each project is connected to a specific db server using a jdbc connection. Each project is named 'admin' and 'tracker'. Both projects are connected to the same db server. Therefore, I made the same settings in the jdbc configuration file of both projects.

jdbc.driverClass=org.mariadb.jdbc.Driver
jdbc.url=jdbc:mariadb://192.168.121.3:3306/emaul_bis_dev
jdbc.username=*******
jdbc.password=*******

And when I start the tomcat server, the 'admin' project connects to the db normally. But the 'tracker' project doesn't connect to the db. Moreover, if you look at the Eclipse log, it tries to connect to the IP of my development PC instead of the specified DB IP Address, and of course the connection is not made and it stops with an exception. With a message that the connection to the DB failed.

This is Console Error message in Eclipse

Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Could not connect: Access denied for user '********'@'192.168.121.1' (using password: YES))

The account name has been changed to ****.

I tried to search whether my ip is included in the project code, but the search result is 0.

If anyone has seen this, or has overcome it, please help how you dealt with it. Thank you.

0 Answers
Related