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

Tomcat CloudFoundry上的Grails应用程序将不会重新启动,tomcat,grails,cloud-foundry,Tomcat,Grails,Cloud Foundry,我正在使用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.c

我正在使用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插件和创建作业的时间有关

显然,我不能每次更改应用程序时都继续重新创建新数据库

我如何解决这个问题


谢谢你的建议!这让我抓狂。

我对Grails和quartz插件有问题

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

在我的例子中,作业文件夹位于

grails-app/jobs

在STS中未列为源文件夹,因此在应用程序启动时请求作业时,应用程序正在关闭。

事实证明,由于某些级联问题,我在引导执行期间遇到此异常

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing
部分问题是我看不到错误。查找此类问题的一个非常有用的标志是FailOneError:

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
vmc文件日志
vmc文件tomcat/logs
通过这些命令,可以查看日志文件的内容:

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
vmc文件日志/stdout.log
vmc文件日志/stderr.log
vmc文件tomcat/logs/localhost.2012-10-11.log
vmc文件tomcat/logs/catalina.2012-10-11.log

我希望这对某人有帮助。它确实帮了我的忙。

不,应用程序在我的机器上启动得很好,而且作业肯定能运行。(但是我没有给你答案。):-)但是你说得有道理。同样的事情也发生在我身上,我从未想过要将它添加为源文件夹。自从我意识到它是在grails应用程序下,我就一直导航到它。但现在我要将其添加到源文件夹列表中。我又遇到了同样的问题,即使删除应用程序和服务并开始清理也无法解决问题。在深入研究logs/stdout.log中发现的异常时,有些东西不符合要求。这让我在STS中做了一次大扫除。一旦我做到了这一点,重新部署工作终于如期进行了。