我想完全禁用它并且不使用内存数据库。当我删除属性时, Play 提示数据库未定义。有什么帮助吗?
@68ajai6kn 无法在 PROD 模式下启动并出现错误
JPA error A JPA error occurred (Cannot start a JPA manager without a properly configured database): No datasource configured
play.exceptions.JPAException: Cannot start a JPA manager without a properly configured database at play.db.jpa.JPAPlugin.onApplicationStart(JPAPlugin.java:108) at play.plugins.PluginCollection.onApplicationStart(PluginCollection.java:425) at play.Play.start(Play.java:495) at play.Play.init(Play.java:292) at play.server.Server.main(Server.java:158) Caused by: java.lang.NullPointerException: No datasource configured ... 5 more
最佳答案
如果您有任何使用 @Entity
定义的类,Play 将自动创建数据库连接,如果是内存数据库,它也会启动它。
因此,为了防止出现错误,您需要删除所有 @Entity
引用。
关于java - 如何在 PlayFramework 中禁用数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8024145/