Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » RenderTask - Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject"
RenderTask - Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" [message #1018157] Wed, 13 March 2013 09:30 Go to next message
Jonathan Dumont is currently offline Jonathan Dumont
Messages: 23
Registered: January 2013
Location: Laval
Junior Member
Hi,

I'm trying to use separated Run and Render task to generate a report, in an Eclipse RCP application.

Our reports where previously generated with a RunAndRenderTask, created with the method createRunAndRenderTask of the Engine. This was working well.

Now that we try to use separated Run and Render tasks, we have this error during the rendering execution :
Table (id = 894): 
+ A report document error occurred when loading: Result Data.
Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" for "null" type column "EMF-TestCasesInProject::@self". please make sure class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" is included in BIRT engines class loading path.
org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject (Element ID:894) 
data.engine.LoadReportDocumentError ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: A report document error occurred when loading: Result Data.
Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" for "null" type column "EMF-TestCasesInProject::@self". please make sure class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" is included in BIRT engines class loading path.
org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject (Element ID:894)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1237)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1216)
	at org.eclipse.birt.report.engine.internal.document.v4.ReportItemExecutor.executeQuery(ReportItemExecutor.java:429)
	at org.eclipse.birt.report.engine.internal.document.v4.TableItemExecutor.doExecute(TableItemExecutor.java:72)
	at org.eclipse.birt.report.engine.internal.document.v4.ReportItemExecutor.execute(ReportItemExecutor.java:294)
	at org.eclipse.birt.report.engine.internal.document.v4.ContainerExecutor.prepareChildExecutor(ContainerExecutor.java:226)
	at org.eclipse.birt.report.engine.internal.document.v4.ContainerExecutor.hasNextChild(ContainerExecutor.java:110)
	at org.eclipse.birt.report.engine.internal.document.v4.ReportPageExecutorV4.hasNextChild(ReportPageExecutorV4.java:110)
	at org.eclipse.birt.report.engine.internal.document.ReportExecutorWrapper.hasNextChild(ReportExecutorWrapper.java:110)
	at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.hasNextChild(WrappedReportExecutor.java:75)
	at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportExecutor.hasNextChild(WrappedReportExecutor.java:75)
	at org.eclipse.birt.report.engine.layout.html.HTMLPageLM$1.hasNextChild(HTMLPageLM.java:68)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:62)
	at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
	at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
	at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRangeRender.render(RenderTask.java:641)
	at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:294)
	at (...)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029)
	at (...)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at (...)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at (...)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: org.eclipse.birt.data.engine.core.DataException: A report document error occurred when loading: Result Data.
Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" for "null" type column "EMF-TestCasesInProject::@self". please make sure class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" is included in BIRT engines class loading path.
org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject
	at org.eclipse.birt.data.engine.impl.document.viewing.DataSetResultSet.next(DataSetResultSet.java:191)
	at org.eclipse.birt.data.engine.impl.document.util.ExprDataReader1.next(ExprDataReader1.java:201)
	at org.eclipse.birt.data.engine.impl.document.util.ExprResultSet.next(ExprResultSet.java:177)
	at org.eclipse.birt.data.engine.impl.document.ResultIterator.next(ResultIterator.java:167)
	at org.eclipse.birt.report.engine.data.dte.QueryResultSet.next(QueryResultSet.java:191)
	at org.eclipse.birt.report.engine.internal.document.v4.ReportItemExecutor.executeQuery(ReportItemExecutor.java:424)
	... 72 more
Caused by: org.eclipse.birt.data.engine.core.DataException: Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" for "null" type column "EMF-TestCasesInProject::@self". please make sure class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" is included in BIRT engines class loading path.
org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject
	at org.eclipse.birt.data.engine.executor.cache.ResultSetUtil.readResultObject(ResultSetUtil.java:184)
	at org.eclipse.birt.data.engine.impl.document.viewing.DataSetResultSet.next(DataSetResultSet.java:178)
	... 77 more
Caused by: java.io.IOException: org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject
	at org.eclipse.birt.core.util.IOUtil.readObject(IOUtil.java:637)
	at org.eclipse.birt.data.engine.executor.cache.ResultSetUtil.readResultObject(ResultSetUtil.java:173)
	... 78 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject
	at org.eclipse.birt.core.framework.URLClassLoader.findClass1(URLClassLoader.java:188)
	at org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClassLoader.java:156)
	at org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClassLoader.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.birt.core.framework.URLClassLoader.findClass(URLClassLoader.java:151)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.birt.report.engine.executor.ApplicationClassLoader.loadClass(ApplicationClassLoader.java:79)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at org.eclipse.birt.core.util.IOUtil$1.resolveClass(IOUtil.java:627)
	at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
	at java.io.ObjectInputStream.readObject0(Unknown Source)
	at java.io.ObjectInputStream.readObject(Unknown Source)
	at org.eclipse.birt.core.util.IOUtil.readObject(IOUtil.java:633)
	... 79 more


Indeed, the data source that we use is created with the ECore ODA Driver, but I don't understand why it should work with a single RunAndRenderTask, and not with seperated Run and Render...


I have found this post about this problem, but to be honnest I don't find the solution :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=375995

Thanks for you help



Re: RenderTask - Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" [message #1018165 is a reply to message #1018157] Wed, 13 March 2013 09:45 Go to previous messageGo to next message
Jonathan Dumont is currently offline Jonathan Dumont
Messages: 23
Registered: January 2013
Location: Laval
Junior Member
After some debugging, it seems that when I use a RunAndRender task, it don't create a rptDocument. With the separated tasks, the Run create a file rptDocument containing all the needed data for the rendering operation.

Then, during the render, this file is analysed to create the final report. And the error that I have occured during the parsing of this rptDocument, as it try to deserialize an object org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject but it don't find the corresponding class. In the stack trace, it's when this is called by ResultSetUtil :
IOUtil.readObject(dis, DataEngineSession.getCurrentClassLoader( ) );


The question is .... how can I configure my projet or my engine to have the needed class in its class path ?



Re: RenderTask - Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" [message #1018173 is a reply to message #1018165] Wed, 13 March 2013 10:02 Go to previous message
Jonathan Dumont is currently offline Jonathan Dumont
Messages: 23
Registered: January 2013
Location: Laval
Junior Member
I will finally answer by myself Smile

May it's not the best solution but it's working : adding the needed class in the Birt engine configuration class path directly. As the separated Run and Render need to know the class definition to deserialize the rptDocument content :

  // Add a custom appContext value on this configuration
  ((HashMap<Object, Object>) engineConfig.getAppContext()).put(
    EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
    JavaObject.class.getClassLoader());


Previous Topic:BIRT 2.4 & 2.6.2 - DataEngine Folder in temp - cleanup
Next Topic:Export Birt report in Excel
Goto Forum:
  


Current Time: Sat Oct 25 15:22:13 GMT 2014

Powered by FUDForum. Page generated in 0.09737 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software