0

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プラグインを追加してジョブを作成したときに関連している可能性があります。

明らかに、アプリケーションに変更を加えるたびに新しいデータベースを再作成し続けることはできません。

これを解決するにはどうすればよいですか?

アドバイスありがとうございます!これは私を狂わせています。

4

2 に答える 2

1

Grailsとクォーツプラグインに問題がありました。

コマンドラインからプラグインをインストールすると、grails install quatz-plugingrails-appの下にJobsという名前のフォルダーが作成され、そこにソースが追加されましたが、STSはそれをソースの有効なフォルダーとして認識せず、使用しようとするたびにアプリがクラッシュしましたそれ

私の場合、下のジョブフォルダ

grails-app/jobs

STSにソースフォルダーとしてリストされていなかったため、アプリの起動時にジョブが要求されたときにアプリケーションが停止していました。

于 2012-10-10T15:06:43.597 に答える
1

いくつかのカスケードの問題が原因で、ブートストラップの実行中にこの例外が発生していたことがわかりました。

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

問題の一部は、エラーが表示されなかったことです。このような問題を見つけるための非常に便利なフラグはfailOnErrorです。

o.save(failOnError:true)

そのフラグをsave()呼び出しに追加すると、例外が表示されました。そして、例外を取り除くと、アプリが再び実行を開始し、更新と再起動もできるようになりました。

そして、CloudFoundryを操作するためのもう1つの便利なヒントがあります。これらのコマンドを使用すると、ログファイルを一覧表示できます。

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

これが誰かに役立つことを願っています。それは確かに私を助けました。

于 2012-10-11T02:23:21.993 に答える