为什么Playframework数据库配置错误在application.conf中 [英] Why Playframework database configuration error in application.conf
问题描述
我已经安装了正确的PostgreSQL,我可以使用其他框架如Spring。当我尝试写一些代码为Play 2.1应该使用postgresql 9.4.1。我也使用Slick 3.0。
我在application.conf中有以下内容
db.default。 driver =org.postgresql.Driver
db.default.url =jdbc:postgresql:mydb
db.default.user = myuser
db.default.password = mypass
它给出错误: -
缺少配置[db.ansiDump.driver]
db.ansiDump.driver =org.postgresql.Driver
db.ansiDump.url =jdbc:postgresql: mydb
然后我得到错误: -
缺少配置[db.unicodeDump.driver]
我添加了
db.unicodeDump.driver =org.postgresql.Driver
db.unicodeDump.url =jdbc:postgresql:mydb
然后我得到错误: -
缺少配置[db.dumpPaths.driver]
我再次添加: -
db.dumpPaths.driver =org.postgresql.Driver
db.dumpPaths.url =jdbc:postgresql:mydb
在所有这些顺序的驱动程序和url,它工作。我确定,我做错了配置驱动器的网址。
请告诉我有什么问题,以及应该怎么做。
更新信息: -
其他信息。
保持整个application.conf文件内容的正确格式。所以我将其上传到Google云端硬盘。请检查链接在此输入链接。
为了重现错误,我必须注释行号45#db.ansiDump.driver =org.postgresql.Driver
注释后我得到这个异常: -
配置错误
缺少配置[db.ansiDump.driver]
In / Users / work / app / conf / application.conf:45
我认为网址应为
db.default.url =jdbc:postgresql:// localhost:5432 / dbName
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
I think the url should be
db.default.url="jdbc:postgresql://localhost:5432/dbName"
这篇关于为什么Playframework数据库配置错误在application.conf中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!