gpt4 book ai didi

database - Playframework 无法在生产环境中读取数据库表?

转载 作者:搜寻专家 更新时间:2023-10-30 20:20:50 27 4
gpt4 key购买 nike

我使用 play 1.2.1 生成我的 war 应用程序。我在生产中使用 tomcat 6 和 mysql 5 db。我已经创建了我的数据库,并将所有本地表导入到生产数据库。

在我将我的应用程序部署到 myapps tomcat 目录后,我重新启动了我的服务器,一切正常,您可以在这样的日志文件中看到。

Jul 23, 2011 11:20:52 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
23:20:53,156 INFO ~ Starting /usr/local/shared/tomcat/mainindonesia/webapps/ROOT/WEB-INF/application
23:20:53,159 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.crud)
23:20:53,159 ERROR ~ Module crud will not be loaded because /usr/local/shared/tomcat/mainindonesia/webapps/ROOT/WEB-INF/modules/crud does not exist
23:20:53,159 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.secure)
23:20:53,159 ERROR ~ Module secure will not be loaded because /usr/local/shared/tomcat/mainindonesia/webapps/ROOT/WEB-INF/modules/secure does not exist
23:20:53,160 INFO ~ Module secure is available (/usr/local/shared/tomcat/mainindonesia/webapps/ROOT/WEB-INF/application/modules/secure)
23:20:53,160 INFO ~ Module crud is available (/usr/local/shared/tomcat/mainindonesia/webapps/ROOT/WEB-INF/application/modules/crud)
23:20:53,299 INFO ~ Application is precompiled
23:20:56,203 INFO ~ Connected to jdbc:mysql://localhost:3306/mainindonesia?autoReconnect=true
23:20:57,870 INFO ~ Application 'Website permainan tradisional anak Indonesia' is now started !
23:20:58,297 INFO ~ Forcing PROD mode because deploying as a war file.

访问主页时出现问题。此错误出现在我的服务器日志中:

Jul 23, 2011 11:20:58 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/,J2EEApplication=none,J2EEServer=none
Jul 23, 2011 11:20:58 PM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-6503
Jul 23, 2011 11:20:58 PM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-4503
Jul 23, 2011 11:20:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6564 ms
23:24:01,285 WARN ~ SQL Error: 1146, SQLState: 42S02
23:24:01,285 ERROR ~ **Table 'mainindonesia.Permainan' doesn't exist**
23:24:01,381 ERROR ~

@677bmo2el
Internal Server Error (500)

Execution exception (In /app/controllers/Application.java around line 26)
JPAQueryException occured : Error while executing query from models.Permainan ORDER BY postedAt DESC: Table 'mainindonesia.Permainan' doesn't exist

在我的产品数据库中,表存在但应用程序无法读取我的表。

最佳答案

搜索后我找到了this页。解决方案是:编辑 application.conf 文件并取消注释“jpa.ddl=update”行。

关于database - Playframework 无法在生产环境中读取数据库表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6805378/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com