Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Runtime error while using BIRT xml plugin
cmalnoe
<p>Hi,</p>
<p> </p>
<p>I'm using birt to generate xml files.</p>
<p>In order to do that, i created a plugin : <strong>org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter.</strong>.</p>
<p>From this plugin, i generate a jar that i'm using in a war to create the xml file.</p>
<p> </p>
<p>So I have two projects : the emitter plugin and the web app using it.</p>
<p> </p>
<p>While calling this plugin (jar) from the web app on the production server, i got this error :</p>
<p>(In the test server it's fine)</p>
<p> </p>
<p>juil. 06, 2015 2:37:44 PM <strong>org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter<br>
GRAVE: Report engine can not create emitter org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter.</strong><br>
juil. 06, 2015 2:37:44 PM org.eclipse.birt.report.engine.api.impl.EngineTask handleFatalExceptions<br>
GRAVE: An error happened while running the report. Cause:<br>
org.eclipse.birt.report.engine.api.EngineException: Report engine fails to initialize org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter emitter, please make sure required libraries for this emitter are installed.<br>
at org.eclipse.birt.report.engine.api.impl.EngineTask.createContentEmitter(EngineTask.java:1763)<br>
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:106)<br>
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)<br>
at fr.inra.means.birt.report.BirtView.runReportEngine(BirtView.java:232)<br>
at fr.inra.means.birt.report.BirtView.renderMergedOutputModel(BirtView.java:123)<br>
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)<br>
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)<br>
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)<br>
[...]<br>
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)<br>
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)<br>
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)<br>
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)<br>
at java.lang.Thread.run(Thread.java:745)<br>
Caused by: java.lang.NoClassDefFoundError: org/eclipse/birt/report/engine/emitter/ContentEmitterAdapter<br>
at java.lang.ClassLoader.defineClass1(Native Method)<br>
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)<br>
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)<br>
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)<br>
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)<br>
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)<br>
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)<br>
at java.security.AccessController.doPrivileged(Native Method)<br>
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)<br>
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)<br>
at java.lang.ClassLoader.loadClass(ClassLoader.java:412)<br>
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)<br>
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1456)<br>
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)<br>
at java.lang.Class.forName0(Native Method)<br>
at java.lang.Class.forName(Class.java:191)<br>
at org.eclipse.birt.core.framework.jar.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:46)<br>
at org.eclipse.birt.core.framework.eclipse.EclipseConfigurationElement.createExecutableExtension(EclipseConfigurationElement.java:35)<br>
at org.eclipse.birt.report.engine.extension.internal.ExtensionManager.createObject(ExtensionManager.java:482)<br>
at org.eclipse.birt.report.engine.extension.internal.ExtensionManager.createEmitter(ExtensionManager.java:312)<br>
at org.eclipse.birt.report.engine.api.impl.EngineTask.createContentEmitter(EngineTask.java:1757)<br>
... 68 more<br>
Caused by: java.lang.ClassNotFoundException: org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter<br>
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)<br>
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)<br>
at java.security.AccessController.doPrivileged(Native Method)<br>
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)<br>
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)<br>
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)<br>
... 89 more</p>
<p> </p>
<p>Both of my servers (prod and test) have the same config (windows servers/glassfish 3.1.2.2, java 7 (u67).</p>
<p> </p>
<p>In order to call the emitter, i do :</p>
<p> </p>
<p>final IRenderOption xmlOptions = new RenderOption(options);<br>
xmlOptions.setOutputFormat("xml");<br>
xmlOptions.setOutputStream(response);<br>
runAndRenderTask.setRenderOption(xmlOptions);<br>
runAndRenderTask.setEmitterID("org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter");</p>
<p> </p>
<p>My dependencies for the report in the war are :</p>
<p> </p>
<p><dependency><br>
<groupId>org.eclipse.birt.runtime</groupId><br>
<artifactId>org.eclipse.birt.runtime</artifactId><br>
<version>4.4.2</version><br>
</dependency></p>
<p> </p>
<p>and the jar generated from the plugin using tycho.</p>
<p><dependency><br>
<groupId><br>
org.eclipse.birt.report.engine.emitter.xml<br>
</groupId><br>
<artifactId><br>
org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter<br>
</artifactId><br>
<version>${plugin-emitter-xml}</version><br>
</dependency></p>
<p> </p>
<p> </p>
<p>You we'll find the plugin project in attached files.</p>
<p> </p>
<p>Do you have any clues? Do I need to register in an other way this plugin? (how does it work?), on glassfish?</p>
<p> </p>
<p> </p>
<p>Thanks in advance,</p>
<p> </p>
<p>Caroline</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
JFreeman
<p>The error indicates it's class path related in that it cannot load the org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.</p>
<p>This class located inside the org.eclipse.birt.eport.engine jar.</p>
<p>I would start by making sure this can be loaded through your class path properly. This should resolve the error you are current getting.</p>
cmalnoe
<p>Thanks for your response.</p>
<p> </p>
<p>The point is this class is in the classpath, as it's in the org.eclipse.birt.runtime-4.3.1.jar (or 4.4.2 i tried both), which is included in the war web-INF/lib.</p>
<p>Maybe there is conflicts while invocing this class?</p>
<p> </p>
<p> </p>
<p>Moreover, it looks like it depends on the environnement as it's work fine in my test web server but not in my prod server.</p>
<p>I put my 2 environnement on debug mode FINEST : It looks like it doesn't execute the same way (not same logs)</p>
<p>In the prod server (error) i got :</p>
<p>juil. 07, 2015 11:46:25 AM org.eclipse.birt.report.engine.api.impl.EngineTask loggerParamters<br>
PRÉCIS: Running the report with paramters: etapeID:21<br>
resID:3<br>
nbRow:84<br>
baseProd:1<br><br><strong>juil. 07, 2015 11:46:25 AM org.eclipse.birt.report.engine.api.impl.EngineTask createContentEmitter</strong><br>
GRAVE: Report engine can not create emitter org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter.<br>
juil. 07, 2015 11:46:25 AM org.eclipse.birt.report.engine.api.impl.EngineTask handleFatalExceptions<br>
GRAVE: An error happened while running the report. Cause:<br>
org.eclipse.birt.report.engine.api.EngineException: Report engine fails to initialize org.eclipse.birt.report.engine.emitter.xml.XMLReportEmitter emitter, please make sure required libraries for this emitter are installed.<br>
at org.eclipse.birt.report.engine.api.impl.EngineTask.createContentEmitter(EngineTask.java:1763)<br>
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:106)</p>
<p>
</p>
<p>For the same action in the test server (fine), i got :</p>
<p> </p>
<p>PRÉCIS: EngineTask.setParameterValue: etapeID=582 [java.lang.Integer]<br>
juil. 06, 2015 9:58:34 AM org.eclipse.birt.report.engine.api.impl.EngineTask loggerParamters<br>
PRÉCIS: Running the report with paramters: etapeID:582<br>
resID:442<br>
nbRow:84<br>
baseProd:0<br><br><strong>juil. 06, 2015 9:58:40 AM org.eclipse.birt.data.engine.api.DataEngineContext DataEngineContext</strong><br>
PLUS PRÉCIS: ENTRY 3 [object Object] null null org.eclipse.birt.report.engine.executor.ApplicationClassLoader@7bb71a8f<br>
juil. 06, 2015 9:58:40 AM org.eclipse.birt.data.engine.api.DataEngineContext DataEngineContext<br>
PLUS PRÉCIS: RETURN<br>
juil. 06, 2015 9:58:40 AM org.eclipse.birt.data.engine.impl.DataEngineImpl DataEngineImpl<br>
PLUS PRÉCIS: ENTRY org.eclipse.birt.data.engine.api.DataEngineContext@11dc4de6<br>
juil. 06, 2015 9:58:40 AM org.eclipse.birt.data.engine.impl.DataEngineSession DataEngineSession</p>
<p> </p>
<p> </p>
<p> </p>
<p>Should I do something specific to add it to the classpath? (in glassfish)? I tried putting this jar(org.eclipse.birt.runtime-4.3.1.jar) in the lib/endorsed of glassfish which leads me to deployment errors...</p>
<p> </p>
<p> </p>
<p>Thanks,</p>
<p>Caroline</p>
JFreeman
<p>If you have it working in your test environment, I think the best action would be to investigate what is different between the test and prod environments.</p>
<p> </p>
<p>There is a chance a conflict could be causing an issue that is preventing the class from loading properly.</p>
<p>Do you have anything that could be causing a conflict in prod that is not in test?</p>
<p>Do you have any other differences between the libraries deployed in prod vs your test environment?</p>
cmalnoe
<p>I did compare the 2 environments: glassfish version (domain.xml same), java used by jvm, environnment variables, OS... I don't know what to check more.</p>
<p> </p>
<p>Between the prod and test this is the same war.</p>
<p> </p>
<p>what do you means by "Do you have any other differences between the libraries deployed in prod vs your test environment". librairies (jar) in glassfish? Nothing different here.</p>
<p> </p>
<p>Do you have an idea what should i look for? Can it be linked to osgi issues?</p>
<p> </p>
<p>Caroline</p>