0

I just upgraded to Play 2.4 and for whatever reason I'm unable to load up the JDBC MySQL driver. Here is what I have in build.sbt

libraryDependencies ++= Seq(
  javaJdbc,
  cache,
  javaWs,
  "mysql" % "mysql-connector-java" % "5.1.+",
  evolutions

)

After refreshing (IntelliJ) and running the application, I still receive the following error

Caused by: java.lang.ClassNotFoundException: org.mysql.jdbc.Driver

I've searched for any potential issues, but haven't come across any. Is there some bug with sbt that I don't know about?

Zarathuztra
  • 3,057
  • 1
  • 18
  • 33

1 Answers1

2

Most probably (just shooting) you have a typo in your application.conf - it should be: com.mysql.jdbc.Driver with exact version (not org.mysql...)

db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost/your_db_name?characterEncoding=UTF-8"
db.default.user=your_login
db.default.password=your_pass

See also here or in the 2.4.x docs

Community
  • 1
  • 1
biesior
  • 54,554
  • 10
  • 118
  • 177