• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Could not create connection to database server.

Newbie Spellweaver
Joined
Jan 19, 2022
Messages
6
Reaction score
0
Hey

Server version v214
Trying to Run the Server.java file in NB and getting this error:

Code:
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

Full code paste bin: HERE

Can anyone help solve? I edited everything to the right db info

Thanks
 
Initiate Mage
Joined
Mar 24, 2023
Messages
4
Reaction score
0
MySQL in pom.xl is probably on the older side - change it to use version 8, in hibernate.cfg the server will probably want you to change com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver
 
Upvote 0
Newbie Spellweaver
Joined
Jan 19, 2022
Messages
6
Reaction score
0
MySQL in pom.xl is probably on the older side - change it to use version 8, in hibernate.cfg the server will probably want you to change com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver
I did that too - it was outdated (version 5) but still no luck
same issue sadly.

EDIT: Now I have an error in DatabaseManager.java something to do with the
Code:
import com.mysql.jdbc.Connection;
line.

Cannot find symbol
symbol : class Connection
location: package com.mysql.jdbc

Unused import
 
Last edited:
Upvote 0
Initiate Mage
Joined
Mar 24, 2023
Messages
4
Reaction score
0
I did that too - it was outdated (version 5) but still no luck
same issue sadly.

EDIT: Now I have an error in DatabaseManager.java something to do with the
Code:
import com.mysql.jdbc.Connection;
line.

Cannot find symbol
symbol : class Connection
location: package com.mysql.jdbc

Unused import
That import should be okay to optimize and then do a project rebuild. It looks like the connection to the DB itself is had with the hibernate imports instead of importing the jdbc connection when switching it from ver.5 to ver.8. I could be wrong, but let's get you up and running if we can.

Did you happen to upgrade the dependencies for the server project folder? I upgraded dependencies for one and had to roll back as well.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 19, 2022
Messages
6
Reaction score
0
That import should be okay to optimize and then do a project rebuild. It looks like the connection to the DB itself is had with the hibernate imports instead of importing the jdbc connection when switching it from ver.5 to ver.8. I could be wrong, but let's get you up and running if we can.

Did you happen to upgrade the dependencies for the server project folder? I upgraded dependencies for one and had to roll back as well.
Do you mind giving me your discord?
 
Upvote 0
Back
Top