スティルハウスの書庫の書庫

はてなダイアリーで書いてた「スティルハウスの書庫」を移転してきました。

NoClassDefFoundErrorが発生するメカニズム

謎なエラーのひとつ、NoClassDefFoundErrorについてヒントとなりそうなポストがMLにありました。

http://groups.google.com/group/google-appengine-java/browse_thread/thread/ec4a06cd90cc49f3#

You had a request back at 09-25 06:27AM 29.110 that exceeded the 30 second
deadline during class initialization and therefore this class was never
loaded properly.  We have some code to detect failures of this kind, but a
large enough percentage of your requests apparently did not need this class
and succeeded, so you never triggered our thresholds.  I've reloaded your
application into this particular JVM, which shouldn't generally be necessary
but you can do by redeploying your application in a pinch.

(NoClassDefFoundErrorが出る前のリクエストにて、クラス初期化中に30秒制限にひっかかり、クラスが正しくロードされない状態となった。(appengineには)こういった障害を検出する仕組みがあるが、大半のリクエストには影響してなかったので、検出のしきい値を超えなかった。該当するJVMにアプリをリロードしておいた。同じことはアプリケーションの再デプロイでも可能だが、普通はそこまでしなくてよいはず)

We will have a fix for this specific issue coming up in the next release,
and we're currently working on some longer term changes that will
dramatically speed up class loading for all applications and hopefully make
this kind of issue much less common. 

(この問題については次のリリースで対策がなされる予定。すべてのアプリのクラスロードを劇的に高速化するための長期的な改修を実施中で、こうした問題はより少なくなるはず)