Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317661

Summary: java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy not always, only sometimes
Product: z_Archived Reporter: sukrutrajmane
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: berenice.maurel, bluesoldier, hustlg
Version: unspecified   
Target Milestone: 3.7.0   
Hardware: PC   
OS: Linux   
Whiteboard: Obsolete

Description sukrutrajmane CLA 2010-06-23 03:47:48 EDT
Build Identifier: 20100218-1602

Our program generates pdf reports using Birt 2.3.1 or 2.5.2 runtime in multi threaded mode.
We have Perl script which calls standalone java programs which executes in multi-threaded mode where number of threads can be configured before starting the program.

For both Birt 2.3.1 and 2.5.2 runtimes, I have observed sometimes when we increase the number of threads we get below exceptions and birt report engine keeps on throwing these exceptions continuously for few seconds (say 10-20 seconds) after which somehow it stops throwing exceptions and continues to generate pdf reports again. Also while throwing exceptions, it generates pdf reports but at a significant low speed.

Exception is as follows...

Jun 3, 2010 2:51:33 AM org.eclipse.birt.report.engine.api.impl.RunAndRenderTask doRun
SEVERE: Error happened while running the report.
java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy
at org.eclipse.birt.report.engine.parser.HTMLTextParser.<init>(HTMLTextParser.java:55)
at org.eclipse.birt.report.engine.parser.TextParser.parse(TextParser.java:110)
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.processForeignData(HTML2Content.java:317)
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.html2Content(HTML2Content.java:297)
at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.startForeign(PDFLayoutEmitter.java:493)
at org.eclipse.birt.report.engine.layout.pdf.emitter.WrappedPDFLayoutEmitter.startForeign(WrappedPDFLayoutEmitter.java:333)
at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitterProxy.startForeign(PDFLayoutEmitterProxy.java:319)
at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startForeign(CompositeContentEmitter.java:260)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:75)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:144)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startForeign(ContentEmitterAdapter.java:165)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:75)
at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:115)
at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:227)
at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:50)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:132)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:104)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:153)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:76)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:151)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:72)
at MyProgram.runAndRenderReport(MyProgram.java:961)
at MyProgram.run(MyProgram.java:192)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.w3c.tidy.Tidy
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:481)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 39 more
Jun 3, 2010 2:51:33 AM org.eclipse.birt.report.engine.api.impl.RunAndRenderTask doRun
SEVERE: Error happened while running the report.
java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy
at org.eclipse.birt.report.engine.parser.HTMLTextParser.<init>(HTMLTextParser.java:55)
at org.eclipse.birt.report.engine.parser.TextParser.parse(TextParser.java:110)
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.processForeignData(HTML2Content.java:317)
at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.html2Content(HTML2Content.java:297)
at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitter.startForeign(PDFLayoutEmitter.java:493)
at org.eclipse.birt.report.engine.layout.pdf.emitter.WrappedPDFLayoutEmitter.startForeign(WrappedPDFLayoutEmitter.java:333)
at org.eclipse.birt.report.engine.layout.pdf.emitter.PDFLayoutEmitterProxy.startForeign(PDFLayoutEmitterProxy.java:319)
at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startForeign(CompositeContentEmitter.java:260)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:75)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:144)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startForeign(ContentEmitterAdapter.java:165)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:75)
at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:115)
at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:227)
at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:50)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:132)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:104)
at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:153)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLTableBandLM.layoutChildren(HTMLTableBandLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:27)
at org.eclipse.birt.report.engine.layout.html.HTMLTableLM.layoutChildren(HTMLTableLM.java:76)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:133)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:68)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:151)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:72)
at MyProgram.runAndRenderReport(MyProgram.java:961)
at MyProgram.run(MyProgram.java:192)
at java.lang.Thread.run(Unknown Source)

Strange thing is why sometimes it throws “NoClassDefFoundError: org/w3c/tidy/Tidy” error and after few seconds automatically stops throwing the errors.

We need to get rid of these exceptions as those are slowing down our report generation process as well as unnecessarily blocking the resources.

Reproducible: Sometimes

Steps to Reproduce:
1. Increase number of threads and pass it to wrapper Perl script which creates that much java processes to generate BIRT pdfs.
2. Single standalone java program which is being spawned from Perl script generate separate report engine.
3. After some time java program will start throwing above mentioned exception
4. After few seconds or one minute it will stop throwing exception
Comment 1 BiM Mising name CLA 2010-07-20 08:33:40 EDT
Hi,

This problem can be reproduce if you launch two instances of the BIRT engine in the same time. To avoid it, you should manage a pool to generate your files or duplicate the BIRT engine (runtime folders) and manage multiple calls.

BIRT engine is not designed to manage this case. You have to adapt your application and it will work correctly.

Regards,
BiM
Comment 2 Gang Liu CLA 2010-12-09 03:24:05 EST
Mulitple threads load the jar file in the same time, and
the jar file is locked by one thread, so the exception is thrown out.

I think this bug is the same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=302219.
Comment 3 Xiaoying Gu CLA 2011-03-01 22:14:59 EST

*** This bug has been marked as a duplicate of bug 302219 ***