10

I am using postgresql 9.2 with play framework 2.1

I downloaded the driver here: http://jdbc.postgresql.org/download.html (JDBC4 Postgresql Driver, Version 9.2-1002)

My project/Build.scala file is as follows:

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

  val appName = "myApp"
  val appVersion = "0.1"

  val appDependencies = Seq(
    "postgresql" % "postgresql" % "9.2-1002.jdbc4")

  val main = play.Project(appName, appVersion, appDependencies)
}

I have placed the jdbc driver in the following locations in the play directory structure:

myApp/lib/postgresql-9.2-1002.jdbc4.jar
myApp/lib/9.2-1002.jdbc4.jar
myApp/lib/postgresql/postgresql/9.2-1002.jdbc4.jar

However, running the app with play run, I get the following error and the build fails:

[warn]  module not found: postgresql#postgresql;9.2-1002.jdbc4              
[warn] ==== local: tried
[warn]   /home/ubuntu/play-2.1.0/repository/local/postgresql/postgresql/9.2-1002.jdbc4/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/postgresql/postgresql/9.2-1002.jdbc4/postgresql-9.2-1002.jdbc4.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::                       
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: postgresql#postgresql;9.2-1002.jdbc4: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: postgresql#postgresql;9.2-1002.jdbc4: not found

Any tips on how to get the Play! to recognize my jar file?

5 Answers 5

14

The 9.2 version of Postgresql driver has not yet hit the Maven central repo, so you'll have to use the 9.1 version :

"postgresql" % "postgresql" % "9.1-901-1.jdbc4"

Or you can use the 9.2 version by dropping the JAR in your myApp/lib folder and remove any dependency from your project/Build.scala file (the lib folder is automatically added by sbt).

Sign up to request clarification or add additional context in comments.

1 Comment

Yep, silly me. I need to remove the dependency from Build.scala if I want to include it manually in myApp/lib. Cheers
13

I have found this in the Repository:

"org.postgresql" % "postgresql" % "9.2-1003-jdbc4"

1 Comment

The newer versions are also there
1

When I change 9.2 version to 9.1 version, it works perfectly. Thanks for your answer nico_ekito

My buid.scala

  val appDependencies = Seq(
  "postgresql" % "postgresql" % "9.1-901-1.jdbc4",
  jdbc,
  javaCore,
  javaEbean
  )

My application.conf

db.default.driver=org.postgresql.Driver
db.default.url="jdbc:postgresql://localhost:5432/DBName"
db.default.user=postgres
db.default.password=123456

Comments

0

I solved the problem using the information at the following link:

https://github.com/tminglei/slick-pg/issues/1

I hope you find it useful!! :)

good luck ;)

linixinil.

1 Comment

Please describe the solution here -- do not just point to a URL.
0

In file application.conf:

 db.default.driver=org.postgresql.Driver
 db.default.url="jdbc:postgresql://localhost:5432/dataBaseName"
 db.default.user=user
 db.default.password="password"

create the pasta /lib in your main project and should add the .jar do postgres.

Download here, and after reload the project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.