DIVERSIFY-project / amiunique

Learn how identifiable you are on the Internet
https://amiunique.org/
MIT License
688 stars 92 forks source link

Connection error while running the code #64

Open meraki-mk opened 2 years ago

meraki-mk commented 2 years ago

The following steps were performed:

  1. Created a local database and imported fpDB.sql using the command mysql -u user_name -p new_database_name < fpDB.sql
  2. Modified the credentials (user and password) in application.conf and persistence.xml files

Java version:

openjdk version "1.8.0_352"
OpenJDK Runtime Environment (build 1.8.0_352-8u352-ga-1~20.04-b08)
OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode)

Scala Version: 2.11.6

On running ./activator run at the root of the website directory I am getting Configuration error. The stack trace is:

[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.lang.NullPointerException.Message:Could not create connection to database server.
[error] application - 

! @7pkngm5c8 - Internal server error, for (GET) [/] ->

play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]]
    at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:94) ~[play_2.11-2.3.10.jar:2.3.10]
    at play.api.Configuration.reportError(Configuration.scala:743) ~[play_2.11-2.3.10.jar:2.3.10]
    at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:247) ~[play-jdbc_2.11-2.3.10.jar:2.3.10]
    at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:238) ~[play-jdbc_2.11-2.3.10.jar:2.3.10]
    at scala.collection.immutable.List.map(List.scala:273) ~[scala-library-2.11.6.jar:na]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_352]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_352]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_352]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_352]
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.33.jar:5.1.33]
Caused by: java.lang.NullPointerException: null
    at com.mysql.jdbc.ConnectionImpl.getServerCharset(ConnectionImpl.java:2983) ~[mysql-connector-java-5.1.33.jar:5.1.33]
    at com.mysql.jdbc.MysqlIO.sendConnectionAttributes(MysqlIO.java:1873) ~[mysql-connector-java-5.1.33.jar:5.1.33]
    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1802) ~[mysql-connector-java-5.1.33.jar:5.1.33]
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1206) ~[mysql-connector-java-5.1.33.jar:5.1.33]
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2234) ~[mysql-connector-java-5.1.33.jar:5.1.33]

Can anyone please help me with what I am missing here?