我使用play 1.2.1来生成我的战争应用程序。我使用mysql 5 db生产tomcat 6。 我已经创建了我的数据库,并将所有本地表导入到生产数据库。
将我的应用程序部署到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
在我的prod db中,表存在但应用程序无法读取我的表。
答案 0 :(得分:3)
嗨,大家搜索后我找到了这个页面
http://play.lighthouseapp.com/projects/57987/tickets/304-table-doesnt-exist-on-stax
解决方案是 编辑application.conf文件并取消注释'jpa.ddl = update'行