Hi,

We recently upgraded Tomcat from version 7 to version 8 (8.0.32 to be precise), 
and we immediately noticed a deterioration in the performance. Page load time 
increased from about 500ms to 2500-5000 ms.

One thing we noticed when we looked at some thread dumps, is that quite often a 
ClassNotFoundException can be seen. I found that a bit interesting, because it 
didn't correspond to any ClassNotFoundException in the log file. However, when 
troubleshooting this I noticed that the exception is caught and ignored.

Here is an example stacktrace from one thread dump:

"http-apr-8080-exec-33" Id=282 in RUNNABLE
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Throwable.java:783)
      - locked java.lang.ClassNotFoundException@26bef633
    at java.lang.Throwable.<init>(Throwable.java:287)
    at java.lang.Exception.<init>(Exception.java:84)
    at 
java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:75)
   at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:82)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      - locked java.lang.Object@2ca91dd5
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
      - locked java.lang.Object@64a0e12a
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
      - locked java.lang.Object@1b5f6952
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:344)
    at 
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
      - locked org.apache.catalina.loader.WebappClassLoader@254b720a
    at 
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    at javax.el.ImportHandler.findClass(ImportHandler.java:195)
    at javax.el.ImportHandler.resolveClass(ImportHandler.java:164)
    at 
javax.servlet.jsp.el.ScopedAttributeELResolver.getValue(ScopedAttributeELResolver.java:62)
    at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
    at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:80)
    at org.apache.el.parser.AstEmpty.getValue(AstEmpty.java:46)
    at org.apache.el.parser.AstNot.getValue(AstNot.java:43)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
    at 
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:943)
    at 
org.apache.jsp.template.framework.common.elements.sectionText.sectionText_jsp._jspx_meth_c_005fif_005f3(sectionText_jsp.java:460)


Here is the code on line 460 in sectionText_jsp.java:

_jspx_th_c_005fif_005f3.setTest(((java.lang.Boolean) 
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not empty 
leadtext}", boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, 
null)).booleanValue());


And here is the corresponding line in sectionText.jsp:

<c:if test="${not empty leadtext}">


I cannot for the life of me understand how this simple EL expression can result 
in a ClassNotFoundException.

Also, this problem doesn't occur just with this specific jsp file. In fact, it 
seems to be a different jsp file involved each time. And it doesn't happen 
every time. The fact is that in order for me to recreate the problem in my 
local environment, I had to perform quite a few page requests in the browser, 
and still it only happened once in a while (with different jsp file each time). 
So it is very intermittent, and seems to be something happening deep down in 
the core of Tomcat itself. I'm not claiming it is a Tomcat bug, it could very 
well be some erroneous configuration that we are using. But the error doesn't 
really seem to be related to our code base, or our third party jars.

Has anyone seen this problem before? What could be the cause of it?

Regards
/Jimi

Reply via email to