How to set up PostgreSQL for Play 2.0?

前端 未结 2 1187
一生所求
一生所求 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
    

提交回复
热议问题