https://bz.apache.org/bugzilla/show_bug.cgi?id=62713
Bug ID: 62713
Summary: caching of classes/statics doesn't work
Product: Tomcat 8
Version: 8.5.32
Hardware: PC
Status: NEW
Severity: critical
Priority: P2
Component: Jasper
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ----
The method resolveClass of class ImportHandler uses a cache named "clazzes".
This cache is useless since during every jsp evaluation a bunch of instances of
class ImportHandler were created and every instance has its own cache.
The result is that on all our live shop systems with tomcat 8 (e-commerce
applications) we see blocked threads due to concurrent calls to class loader
getResource.
java.lang.Thread.State: BLOCKED (on object monitor)
at java.util.zip.ZipFile.getEntry(ZipFile.java:314)
- waiting to lock <0x00000003ee5ab130> (a java.util.jar.JarFile)
at java.util.jar.JarFile.getEntry(JarFile.java:240)
at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
at
org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.getArchiveEntry(AbstractSingleArchiveResourceSet.java:97)
at
org.apache.catalina.webresources.AbstractArchiveResourceSet.getResource(AbstractArchiveResourceSet.java:272)
at
org.apache.catalina.webresources.StandardRoot.getResourceInternal(StandardRoot.java:281)
at org.apache.catalina.webresources.Cache.getResource(Cache.java:62)
at
org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:216)
at
org.apache.catalina.webresources.StandardRoot.getClassLoaderResource(StandardRoot.java:225)
at
org.apache.catalina.loader.WebappClassLoaderBase.findResource(WebappClassLoaderBase.java:902)
at
org.apache.catalina.loader.WebappClassLoaderBase.getResource(WebappClassLoaderBase.java:1023)
at javax.el.ImportHandler.findClass(ImportHandler.java:202)
at javax.el.ImportHandler.resolveClass(ImportHandler.java:164)
at
javax.servlet.jsp.el.ScopedAttributeELResolver.getValue(ScopedAttributeELResolver.java:85)
at
org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:94)
at org.apache.el.parser.AstValue.getValue(AstValue.java:137)
at
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
at
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:944)
simple example to show the wrong behaviour:
use a local tomcat and a single jsp containing an undefined expression, e.g.:
${a.b}
At every execution of this jsp the ImportHandler tries to find a class named
"a" with the resource loader and the cache is empty.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]