Our web application is facing a difficult situation
This is a Spring application developed by STS / Tomcat 7 . After the application has been integrated with Jasper report 4.6.0 , it always throws `OutOfMemoryError: PermGen Space. Then the only way to make it work is to restart the application. But after a while this will happen again. Here is the log before the exception:
Oct 17, 2012 3:42:27 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Oct 17, 2012 3:42:30 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception
Here is a section within the exception where I found something about Jasper :
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:442) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:378) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646) at org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:240) at org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:578) at org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:49) at org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:655)
Here are a few conclusions when a situation arises:
A problem can occur on the page without any Jasper Report components. It seems the Jasper Report bean is trying to find the lib tag all the time when a request is processed by the back end and responded to the front end . Usually, from the log file that I see above, an exception will not be thrown until all final operations (JPA control) are completed
When I start log4J in debug mode, I see a lot of information displaying something like parsing / rendering of all components from the Jasper template (text fields, pen, field ...), there is a small section from a huge log
2012-10-17 15:29:12,025 -- DEBUG -- org.apache.commons.digester.Digester.sax -- startElement(http://jasperreports.sourceforge.net/jasperreports,textElement,textElement) 2012-10-17 15:29:12,025 -- DEBUG -- org.apache.commons.digester.Digester -- Pushing body text '' 2012-10-17 15:29:12,025 -- DEBUG -- org.apache.commons.digester.Digester -- New match='jasperReport/summary/band/textField/textElement' 2012-10-17 15:29:12,025 -- DEBUG -- org.apache.commons.digester.Digester -- Fire begin() for FactoryCreateRule[className=net.sf.jasperreports.engine.xml.JRTextElementFactory, attributeName=null, creationFactory=net.sf.jasperreports.engine.xml.JRTextElementFactory@12dc6007] 2012-10-17 15:29:12,025 -- DEBUG -- org.apache.commons.digester.Digester -- [FactoryCreateRule]{jasperReport/summary/band/textField/textElement} New net.sf.jasperreports.engine.design.JRDesignTextField 2012-10-17 15:29:12,025 -- DEBUG -- org.apache.commons.digester.Digester.sax -- ignorableWhitespace()
However, this log is generated when a page is requested that does not contain a Jasper component.
I have done some research, but still can not find a solution to this problem.
The first question is that there is a jasperreport bean in the application, why it always works when it is not even autovexed with the current service (which means that there is no jasper component on the current page). Is there a solution / answer to this situation?
Also from the exception message At least one JAR was scanned for a TLD but did not contain a TLD. at org.apache.jasper.compiler.JDTCompiler.generateClass (JDTCompiler.java:442)
should come from Tomcat and Tomcat never contains any JSTL jar , then I assume that it cannot find a matching TLD to parse the jasper report, so do a full scan of all the jars. If so, how did it happen that the sheer amount of debug logs from org.apache.commons.digester.Digester really seems busy when parsing the jasper template?
In general, make this thread just try to find a solution to the problem, and also find the answer to why Jasper is so active in place, does not require it, and how can we let tomcat parse the templates correctly?
Sorry if too verbose and thanks for any tips.
java spring tomcat jasper-reports jstl
Dreamer
source share