Problem starting the server

134 views
Skip to first unread message

Ignacio BM

unread,
Sep 24, 2021, 3:03:15 PM9/24/21
to l1j-en
Hi!

I'm trying to config the server, but I have a problem when I try to start the server:

2021.09.24 20:59:50 L1DatabaseFactory.getConnection WARNING: L1DatabaseFactory: getConnection() failed, trying again java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://localhost/l1jdb?autoReconnect=true&useUnicode=True&characterEncoding=UTF-8, username = root. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Does anyone got this problem too? Any solution? Any idea?

Thanks.


Ignacio BM

unread,
Sep 26, 2021, 7:18:11 AM9/26/21
to l1j-en
If you get the warning:
2021.09.24 20:59:50 L1DatabaseFactory.getConnection WARNING: L1DatabaseFactory: getConnection() failed, trying again java.sql.SQLException: Unable to open a test connection to the given database. JDBC url = jdbc:mysql://localhost/l1jdb?autoReconnect=true&useUnicode=True&characterEncoding=UTF-8, username = root. Terminating connection pool (set lazyInit to true if you expect to start your database after your app). Original Exception: ------
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

Probably it's because the java mysql connector you are using is outdated for your mysql database.

So you need to update the mysql connector in the project, the one I have is: mysql-connector-java-5.1.31-bin (check lib directory)

Then what I have done is go to mysql and download las java connector for mysql: mysql-connector-java-8.0.26.jar and I added to the project, after that you need be sure that you add this to the path too (right click build path).

Then you need go to build.xml and add the connector too:

<path id="classpath">
    <fileset dir="${lib.dir}">
      <include name="c3p0-0.9.1.2.jar" />
      <include name="javolution.jar" />
      <include name="mysql-connector-java-5.1.31-bin.jar" />
  <include name="mysql-connector-java-8.0.26.jar" />   
      <include name="guava-17.0.jar" />
      <include name="slf4j-api-1.7.5.jar" />
      <include name="slf4j-jdk14-1.7.5.jar" />
      <include name="bonecp-0.8.0.RELEASE.jar" />
      <include name="sshd-core-1.2.0.jar" />
      <include name="netty-all-4.1.29.Final.jar" />
      <include name="javax.activation-api-1.2.0.jar" />
      <include name="jaxb-api-2.3.1.jar" />
    </fileset>

Then you can finally run the build and it should work, and advance to the next step/problem.
Reply all
Reply to author
Forward
0 new messages