Why Playframework database configuration error in application.conf

霸气de小男生 提交于 2019-12-25 17:25:33

问题


I have have correct PostgreSQL installed and I can use this by other framework such as Spring. When I tried write some code for Play 2.1 that should use postgresql 9.4.1. I'm also using Slick 3.0.

I have following in the application.conf

db.default.driver="org.postgresql.Driver"


db.default.url="jdbc:postgresql:mydb"


db.default.user=myuser


db.default.password=mypass

When I start application it give error:-

Missing configuration [db.ansiDump.driver]

I added

db.ansiDump.driver="org.postgresql.Driver"

db.ansiDump.url="jdbc:postgresql:mydb"

Then I get error:-

Missing configuration [db.unicodeDump.driver]

I added

db.unicodeDump.driver="org.postgresql.Driver"


db.unicodeDump.url="jdbc:postgresql:mydb"


Then I get error:-

Missing configuration [db.dumpPaths.driver]

So again I added:-

db.dumpPaths.driver="org.postgresql.Driver"


db.dumpPaths.url="jdbc:postgresql:mydb"


After all these sequence of driver and url, It worked. I am sure, I am doing something wrong to configure drive o url.

Please tell me what is wrong and how it should be done.

Updated infromation:-

Additional information.

Sorry I can't keep correct format for the whole application.conf file content. So I uploaded it in Google Drive. Please check the link enter link description here

To reproduce the error I had to comment line number 45 #db.ansiDump.driver="org.postgresql.Driver"

After comment I get this exception:-

Configuration error Missing configuration [db.ansiDump.driver] In /Users/ma/work/app/conf/application.conf:45


回答1:


I think the url should be

db.default.url="jdbc:postgresql://localhost:5432/dbName"


来源:https://stackoverflow.com/questions/28813624/why-playframework-database-configuration-error-in-application-conf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!