Details
Description
After running for a period (usually a few days) with no load on the server my Tapestry application crashes. Errors in the logs are not always the same but they are similar to this:
org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTProperty_11488aa7b43:
[source error] no such class: $RiskModel_61
Caused by: javassist.CannotCompileException: [source error] no such class: $RiskModel_61
In this example below: the id is an integer with the value 728, remember it works for a few days and then:
21 Aug 2007 13:01:49,353 - INFO $Portfolio_89 - Setting the portfolio with the id: 728
21 Aug 2007 13:01:50,479 - ERROR $Error_118 - Unable to parse OGNL expression 'id': Unable to parse OGNL expression 'id': Unable to parse OGNL expression 'id': ............ etc.
Exception [classpath:/org/apache/tapestry/form/TextArea.jwc, line 49, column 67]
at org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:145)
at org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:125)
And then take a look at this:
21 Aug 2007 07:56:50,613 - ERROR org.apache.tapestry.services.impl.HiveMindExpressionCompiler - Error generating OGNL getter for expression exceptions with root $Exception_119@3c1[framework:Exception] and body:
{ return (($Exception_119)$2).getExceptions();}org.apache.hivemind.ApplicationRuntimeException: Unable to add method java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class $ASTProperty_1146a471a52: [source error] no such class: $Exception_119
The recurring pattern is "no such class: $classname" clearly these classes could be referenced for a time and then no longer.
For some reason ognl/JavaAssist can no longer compile or find classes... Also of note is that when the server is idle for some time (no connections at all) JConsole still shows 18000 classes loaded, a day before there were 7000 classes, this number never goes down only up. In summary there is huge memory consumption by the ClassPool and ognl compilation problems relating to class not found exceptions.