【问题标题】:Grails app fail to deploy to cloudfoundry due to memory leaks由于内存泄漏,Grails 应用程序无法部署到 Cloudfoundry
【发布时间】:2012-09-12 11:49:34
【问题描述】:

我有一个 grails 2.1.0 应用程序,我可以成功地将它部署到 cloudfoundry。经过一些代码更改后,我做了一个 grails prod cf-update,一切都崩溃了。我试图删除 cloudfoundry 应用程序并重新创建它,但没有结果。

这是来自 grails cf-chrashlogs 的日志

| Loading Grails 2.1.0
| Configuring classpath.
| Environment set to production.....
| Compiling 1 source files..
| Compiling 1 source files.
==== logs/stderr.log ====

Sep 12, 2012 11:32:55 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-55735
Sep 12, 2012 11:32:55 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 407 ms
Sep 12, 2012 11:32:55 AM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Sep 12, 2012 11:32:55 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Sep 12, 2012 11:32:55 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Sep 12, 2012 11:32:55 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Sep 12, 2012 11:32:55 AM org.apache.catalina.core.StandardContext checkUnusualURLPattern
INFO: Suspicious url pattern: "/files/**" in context [] - see section SRV.11.2 of the Servlet specification
Sep 12, 2012 11:33:21 AM org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
Sep 12, 2012 11:33:21 AM org.apache.catalina.core.StandardContext start
GRAVE: Context [] startup failed due to previous errors
Sep 12, 2012 11:33:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Sep 12, 2012 11:33:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [net.sf.ehcache.CacheManager@71a1644b] but has failed to stop it. This is very likely to create a memory leak.
Sep 12, 2012 11:33:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [es.pvazquez.judo.security.Role.data] but has failed to stop it. This is very likely to create a memory leak.
Sep 12, 2012 11:33:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [org.hibernate.cache.UpdateTimestampsCache.data] but has failed to stop it. This is very likely to create a memory leak.
Sep 12, 2012 11:33:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [org.hibernate.cache.StandardQueryCache.data] but has failed to stop it. This is very likely to create a memory leak.
Sep 12, 2012 11:33:21 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [] appears to have started a thread named [Compass Scheduled Executor Thread [pool-4-thread-1]] but has failed to stop it. This is very likely to create a memory leak.

==== logs/stdout.log ====


Configuring Spring Security UI ...
... finished configuring Spring Security UI


Configuring Spring Security Core ...
... finished configuring Spring Security Core

2012-09-12 11:33:21,852 [Compass Gps Index [pool-5-thread-2]] ERROR util.JDBCExceptionReporter  - Table 'dc2baf5ca87094d6099e1ac613db0eaad.club' doesn't exist
2012-09-12 11:33:21,854 [Compass Gps Index [pool-5-thread-1]] ERROR util.JDBCExceptionReporter  - Table 'dc2baf5ca87094d6099e1ac613db0eaad.judoka' doesn't exist
2012-09-12 11:33:21,854 [Compass Gps Index [pool-5-thread-4]] ERROR util.JDBCExceptionReporter  - Table 'dc2baf5ca87094d6099e1ac613db0eaad.category' doesn't exist
2012-09-12 11:33:21,854 [Compass Gps Index [pool-5-thread-3]] ERROR util.JDBCExceptionReporter  - Table 'dc2baf5ca87094d6099e1ac613db0eaad.championship' doesn't exist
2012-09-12 11:33:21,859 [Compass Gps Index [pool-5-thread-2]] ERROR indexer.ScrollableHibernateIndexEntitiesIndexer  - {hibernate}: Failed to index the database
org.hibernate.exception.SQLGrammarException: could not execute query using scroll
    at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104)
    at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
    at org.compass.core.CompassTemplate.execute(CompassTemplate.java:133)
    at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:102)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dc2baf5ca87094d6099e1ac613db0eaad.club' doesn't exist
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2318)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    ... 11 more
2012-09-12 11:33:21,861 [Compass Gps Index [pool-5-thread-3]] ERROR indexer.ScrollableHibernateIndexEntitiesIndexer  - {hibernate}: Failed to index the database
org.hibernate.exception.SQLGrammarException: could not execute query using scroll
    at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104)
    at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
    at org.compass.core.CompassTemplate.execute(CompassTemplate.java:133)
    at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:102)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dc2baf5ca87094d6099e1ac613db0eaad.championship' doesn't exist
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2318)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    ... 11 more
2012-09-12 11:33:21,860 [Compass Gps Index [pool-5-thread-4]] ERROR indexer.ScrollableHibernateIndexEntitiesIndexer  - {hibernate}: Failed to index the database
org.hibernate.exception.SQLGrammarException: could not execute query using scroll
    at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104)
    at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
    at org.compass.core.CompassTemplate.execute(CompassTemplate.java:133)
    at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:102)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dc2baf5ca87094d6099e1ac613db0eaad.category' doesn't exist
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2318)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    ... 11 more
2012-09-12 11:33:21,862 [Compass Gps Index [pool-5-thread-1]] ERROR indexer.ScrollableHibernateIndexEntitiesIndexer  - {hibernate}: Failed to index the database
org.hibernate.exception.SQLGrammarException: could not execute query using scroll
    at org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer.performIndex(ScrollableHibernateIndexEntitiesIndexer.java:118)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1$1.doInCompassWithoutResult(ConcurrentParallelIndexExecutor.java:104)
    at org.compass.core.CompassCallbackWithoutResult.doInCompass(CompassCallbackWithoutResult.java:29)
    at org.compass.core.CompassTemplate.execute(CompassTemplate.java:133)
    at org.compass.gps.impl.SingleCompassGps.executeForIndex(SingleCompassGps.java:147)
    at org.compass.gps.device.support.parallel.ConcurrentParallelIndexExecutor$1.call(ConcurrentParallelIndexExecutor.java:102)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'dc2baf5ca87094d6099e1ac613db0eaad.judoka' doesn't exist
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2318)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
    ... 11 more

【问题讨论】:

    标签: mysql grails cloud-foundry


    【解决方案1】:

    您是否在项目中的任何位置创建了表?

    • 表 'dc2baf5ca87094d6099e1ac613db0eaad.club' 不存在

    • 表 'dc2baf5ca87094d6099e1ac613db0eaad.judoka' 不存在

    • 表 'dc2baf5ca87094d6099e1ac613db0eaad.category' 不存在

    • 表 'dc2baf5ca87094d6099e1ac613db0eaad.championship' 不存在

    【讨论】:

    • 我有以下 DataSource.groovy。使用这种配置,它在几天前就可以工作了。类别、俱乐部等是 grails 域对象。他们的表应该是在 MySQL 中自动创建的,不是吗?生产 { 数据源 { 方言 = org.hibernate.dialect.MySQL5InnoDBDialect driverClassName = 'com.mysql.jdbc.Driver' 用户名 = 'n/a' 密码 = 'n/a' url = 'jdbc:mysql://localhost/db ?useUnicode=true&characterEncoding=utf8' dbCreate = 'update' } }
    • 是的,如果您在 DataSource 配置中有“dbCreate='update'”,则会自动创建缺失的表。那么您能否确认在 projectRoot/grails-app/domain/ 下创建了这样的域类。而且您还使用推送了应用程序
    • 好吧,我在 cloudfoundry.com 上创建了一个新帐户,使用这些新凭据我可以成功部署我的应用程序...无需任何更改!所以,我猜这不是我的应用程序的错,但是,问题出在哪里?我该如何解决?谢谢!
    • 目前我很难重现您的问题。但既然你可以在一个单独的环境中制作它,也许你想从头开始尝试。正如您所提到的,首先通过以下方式删除您的应用程序:grails cf-delete-app。 2、通过:grails cf-create-service mysql [name]提供一个新的mysql服务。推送您的应用程序并确保绑定新服务。这应该可以正常工作。
    • 是的,William,我已经尝试使用我的第一个 cloudfoundry 帐户从头开始,但没有成功......唯一不同的是我没有通过“grails cf”创建 mysql 服务-create-service mysql [名称]”。当被要求创建它并在执行“grails prod cf-push”时绑定它时,我只是说“是”。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-30
    • 1970-01-01
    • 1970-01-01
    • 2014-04-12
    • 2017-06-09
    • 2017-06-02
    相关资源
    最近更新 更多