CloudFoundry上的Grails应用程序不会重新启动

时间:2012-10-10 15:00:23

标签: tomcat grails cloudfoundry

我正在使用STS将Grails应用程序部署到CloudFoundry。一切都很顺利,进行编辑并进行“更新和重启”。突然间,我开始遇到应用程序无法成功重启的问题。以下是日志显示的内容:

Oct 10, 2012 2:18:31 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-6401
Oct 10, 2012 2:18:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 380 ms
Oct 10, 2012 2:18:31 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Oct 10, 2012 2:18:31 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 10, 2012 2:18:31 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Oct 10, 2012 2:18:31 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Oct 10, 2012 2:18:43 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 10, 2012 2:18:43 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [net.sf.ehcache.CacheManager@2ff7ac92] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [com.lossless.S2Role.data] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: 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.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: 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.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [quartzScheduler_QuartzSchedulerThread] but has failed to stop it. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Actual transaction active]) and a value of type [java.lang.Boolean] (value [true]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Transactional resources]) and a value of type [java.util.HashMap] (value [{org.apache.commons.dbcp.BasicDataSource@19129103=org.springframework.jdbc.datasource.ConnectionHolder@1251dee1, org.hibernate.impl.SessionFactoryImpl@21faa3c5=org.springframework.orm.hibernate3.SessionHolder@3cff8f2c}]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Current transaction name]) and a value of type [java.lang.String] (value [lossless.MarketScannerJob.execute]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Current aspect-driven transaction]) and a value of type [org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo] (value [PROPAGATION_REQUIRED,ISOLATION_DEFAULT; '']) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
Oct 10, 2012 2:18:43 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: The web application [] created a ThreadLocal with key of type [org.springframework.core.NamedThreadLocal] (value [Transaction synchronizations]) and a value of type [java.util.LinkedHashSet] (value [[]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
....
Stopping Tomcat because the context stopped.

我尝试删除该应用,但这没有帮助。我尝试删除应用程序和数据库,但这没有帮助。昨晚最终工作的是创建一个具有不同名称的新数据库。今天,我又回到了同样的问题。

我不确定问题何时出现,但可能与我添加Quartz插件并创建作业时有关。

显然,每次我对应用程序进行更改时,都无法继续重新创建新数据库。

如何解决此问题?

感谢您的任何建议!这让我疯了。

2 个答案:

答案 0 :(得分:1)

我的Grails和石英插件有问题。

当我通过grails install quatz-plugin命令行安装插件时,它在grails-app下创建了一个名为Jobs的文件夹,并在那里添加了它的源代码,但是STS没有将其识别为源的有效文件夹而且它崩溃了我的应用程序每次尝试使用它

在我的情况下,

下的Job文件夹
grails-app/jobs

未在STS中列为源文件夹,因此应用程序在应用程序启动时应用程序即将死亡。

答案 1 :(得分:1)

事实证明,由于一些级联问题,我在Bootstrap执行期间遇到了这个异常。

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing

部分问题是我看不到错误。找到此类问题的一个非常有用的标志是failOnError:

o.save(failOnError:true)

一旦我将该标志添加到我的save()调用中,我就能看到异常。一旦我摆脱异常,我的应用程序再次开始运行,我现在也可以更新和重新启动。

这是使用CloudFoundry的另一个方便提示。这些命令允许您列出日志文件:

vmc files <appname> logs
vmc files <appname> tomcat/logs

这些命令允许您查看日志文件的内容:

vmc files <appname> logs/stdout.log
vmc files <appname> logs/stderr.log
vmc files <appname> tomcat/logs/localhost.2012-10-11.log
vmc files <appname> tomcat/logs/catalina.2012-10-11.log

我希望这有助于某人。它确实帮助了我。