ここ数週間、再現が難しい問題に断続的に遭遇しています。Grails アプリに一晩触れていない場合、何かがアンロードされて、
次のような値でレンダリングされた GSP:
<meta http-equiv="org.apache.commons.lang.StringUtils@72cd722b" content="org.apache.commons.lang.StringUtils@4e520b18">
<link href="/appname/static/bundle-bundle_application_head.css" type="org.apache.commons.lang.StringUtils@31da0262" rel="org.apache.commons.lang.StringUtils@774121fe" media="org.apache.commons.lang.StringUtils@6008482c" />
<body style="org.apache.commons.lang.StringUtils@49533701">
<a href="/appname/register/forgotPassword" name="org.apache.commons.lang.StringUtils@815a651" class="org.apache.commons.lang.StringUtils@5689bde">Forgotten Password?</a>
これは、Tomcat スタンドアロンに展開され、Grails を IntelliJ で一晩実行したことがあります。
毎晩ではありませんが、ほとんどの場合、仕事をしている場合と仕事をしていない場合の違いをまだ突き止められません。
アプリケーションまたは Tomcat のログに手がかりを与えるものは何もありません。
この時点で、リソース プラグインと関係があるかどうか疑問に思っています。しかし、何を見るべきかについての考えは大歓迎です
環境:
OS Win7 x64 and Redhat 5
Tomcat 7.0.x (also was occuring on latest Glassfish)
Grails 2.0.4
Plugins:
plugins.cache=1.0.0.RC1
plugins.cache-headers=1.1.5
plugins.compress=0.4
plugins.console=1.1
plugins.executor=0.3
plugins.export=1.3
plugins.fields=1.1
plugins.google-visualization=0.5.2
plugins.grails-melody=1.13
plugins.joda-time=1.4
plugins.mail=1.0
plugins.p6spy=0.5
plugins.quartz-monitor=0.2
plugins.spring-security-core=1.2.7.3
plugins.springcache=1.3.1
plugins.zipped-resources=1.0
更新 #1:
Tomcat マネージャーを使用して webapp をリロードすると、次のメッセージが表示されて失敗しますが、Tomcat の再起動時には発生しません。
INFO: Initializing Spring root WebApplicationContext
Jun 3, 2012 7:53:01 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
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: java.lang.ExceptionInInitializerError
at java.lang.Class.forName(Class.java:247)
... 3 more
Caused by: groovy.lang.MissingMethodException: No signature of method: static org.joda.time.DurationFieldType.hour() is applicable for argument types: () values: []
Possible solutions: hours(), wait(), days(), eras(), years(), any()
at grails.plugin.jodatime.taglib.PeriodTagLib$_getPeriodTypeForFields_closure3.doCall(PeriodTagLib.groovy:87)
at grails.plugin.jodatime.taglib.PeriodTagLib.getPeriodTypeForFields(PeriodTagLib.groovy:87)
at grails.plugin.jodatime.taglib.PeriodTagLib.<clinit>(PeriodTagLib.groovy:84)
... 4 more
jodaTimeプラグインのコードは問題ないように見えるので、私は信じていません:
Line 84: private static final PeriodType DEFAULT_PERIOD_TYPE = getPeriodTypeForFields("hours,minutes,seconds")
private static PeriodType getPeriodTypeForFields(String fields) {
Line 87: def fieldTypes = fields.split(/\s*,\s*/).collect { DurationFieldType."$it"() } as DurationFieldType[]
アップデート #2
Melody は、すべての物理メモリがゆっくりと飲み込まれていることを示しています。
アプリがリロードされた場合、これらのログ エントリに関連している可能性があります (常に Tomcat を強制的にシャットダウンし、ハングしている Java プロセスを強制終了して開始します)。
SEVERE: The web application [/appname] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
May 31, 2012 6:04:51 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/appname] appears to have started a thread named [DefaultQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
May 31, 2012 6:04:51 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
または、次の行に沿ったものです: http://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByCommonClassLoader
アップデート #3
物理メモリの問題は解決されましたが、アプリはまだ壊れており、元の投稿と同じように見えます。今回は、アイドル時間が減った後(数時間)