0

I'm totally new to play and trying to add managed MySQL dependency in java play 2.3.6.

build.sbt:

libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.21"

application.conf

db.default.driver=com.mysql.jdbc.Driver
db.default.url="mysql://user:pass@localhost:81/play"

And i get [com.mysql.jdbc.Driver] .

What am i missing?

emc
  • 333
  • 2
  • 16
  • `jdbc:localhost:81/play` does not look like a valid JDBC URL for MySQL. What this URL looks like, depends on the database. Lookup the syntax for the JDBC URL for MySQL and correct it. See [What is the MySQL JDBC driver connection string?](http://stackoverflow.com/questions/1457716/what-is-the-mysql-jdbc-driver-connection-string) – Jesper Nov 16 '14 at 14:07
  • Did you do a `clean` and `dependencies` before trying to compile and run it again? (I have missed that myself some times...) – Michael Rose Nov 16 '14 at 14:10
  • @Jesper - i followed your advice and fixed the url according to this answer: http://stackoverflow.com/questions/1457716/what-is-the-mysql-jdbc-driver-connection-string . But now after clean / run it's stuck on `Compiling 4 Scala sources and 2 Java sources` for the past 8m . Is it supposed to do this? – emc Nov 16 '14 at 14:24
  • @Jesper - finished it, but didn't solved the problem – emc Nov 16 '14 at 14:54

1 Answers1

0

Solved, in case anyone stumbles upon similar problem:

running clean isn't enough, running reload after inserting the dependency solved it for me. (I don't know how is this in older versions, but that is how it is in 2.3.6

emc
  • 333
  • 2
  • 16
  • Changes to your build file are not automatically picked up by an existing sbt session without a `reload`. `clean` only impacts artifacts from your project, not the project build itself. – Ryan Nov 16 '14 at 21:45
  • Just what i said , `clean` isn't enough and `reload` is needed, if you want you can post comprehensive answer and i'll accept in case anyone will find this page with similar problem. – emc Nov 18 '14 at 07:51