I have a thread here to demonstrate current issue in Spring with Jasper report. I have sorted out most of the issue with help from all geniuses from SO but still stuck on solving the memories spent on org.apache.commons.digester
.
The situation is quite common when wired the jasper report bean and if we turn on debug log mode, there are tons of log info from org.apache.commons.digester.Digiester.sax
, EVEN CURRENT PAGE HAS NOTHING TO DO WITH JASPER REPORT
. so seems to me that the jasper bean is not well wired so when the application is running, the container is trying to help the bean get wired at all time.
Here are some normal logs during runtime(happens when there is no jasper report on the view), telling about tld jar confusion, but application can still keep running.
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.
Here is the bean in applicationContext config file, which is a very common bean
<bean id="pdfStandard" class="org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView">
<property name="url" value="classpath:/META-INF/jasperReports/pdf_stardard.jrxml" />
<property name="reportDataKey" value="datasource" />
<property name="headers">
<props>
<prop key="Content-Disposition">attachment; filename=standard.pdf</prop>
</props>
</property>
</bean>
And here is a small cut from the gigabytes log file on debug level, looks like it is parsing the template all the time without a rest
, or trying to parse XML from jasper library?
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()
Now the question are:
Why the
org.apache.commons.digester
keeping "digest" jasper report component, even current view has nothing to do with Jasper report?Still very confused about whether it is the jasper bean not well wired or something wrong with the
digester
so that keep the jasper report bean/template so active. I try to save some unnecessary memory consumption but I guess only turn off the log fromdigester
may not be a solution as they probably still running on the background.I am very confident about when start application on tomcat/vfabbric, jasper report get compile at compile-time instead of load-time. So why it still looks like the 'digester' is working hard on parsing the jasper template?
Many thanks in advance.