How to set up PostgreSQL for Play 2.0?

前端 未结 2 1186
一生所求
一生所求 2020-12-30 05:12

I\'d like to configure PostgreSQL for my Play app, but am getting the following error:

! Internal server error, for request [GET /] ->

java.util.concurre         


        
相关标签:
2条回答
  • 2020-12-30 05:51

    Most probably this is the problem:

    db.default.url="postgres://play:play@localhost:9000/Play_Playground_DB"
    

    The play doku says, "db.default.url" is a plain JDBC-URL. There are two problems with your value:

    • It is not in a format recognized by PostgreSQL. Look here for allowed formats.
    • With ...default... you redefine the default datasource. By default this calls for trouble unless you do some more steps.

    A valid PostgreSQL URL might look like this in your case:

    jdbc:postgresql://localhost:9000/Play_Playground_DB
    

    But:_ Are sure your database is running on port 9000? You say psql Play_Playground_DB works for you. Therefore I think your port should be the default port 5432. Then this URL is the right one:

    jdbc:postgresql://localhost/Play_Playground_DB
    
    0 讨论(0)
  • 2020-12-30 06:00

    On my OSX, I've installed PostgreSQL from homebrew and current version is 9.3.4

    The connection strings described above do not work for me because they are using postresql database name. My connections are established if and only if I specify like:

    db.default.url="postgres://user:password@localhost/MyDbName"
    

    Notice that it is postgres instead of postgresql.

    0 讨论(0)
提交回复
热议问题