Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection error while running the code #64

Open
meraki-mk opened this issue Nov 21, 2022 · 0 comments
Open

Connection error while running the code #64

meraki-mk opened this issue Nov 21, 2022 · 0 comments

Comments

@meraki-mk
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant