Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359306 - ODA Driver Reports produce errors in BIRT Report Viewer
Summary: ODA Driver Reports produce errors in BIRT Report Viewer
Status: RESOLVED WONTFIX
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact: Kenn Hussey CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-28 16:56 EDT by John Conlon CLA
Modified: 2012-10-05 01:38 EDT (History)
0 users

See Also:


Attachments
ReportViewer Error with stack (10.04 KB, text/plain)
2011-09-28 17:02 EDT, John Conlon CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Conlon CLA 2011-09-28 16:56:20 EDT
Build Identifier: 20110615-0604

If a BIRT report contains ECore ODA dataset, running it in the BIRT Report Viewer will produce the error: 

----
The following items have errors:

Table (id = 529):
- A report document error occurred when loading: Result Data.
Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" for "EJavaObject" type column "@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:529)
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 "EJavaObject" type column "@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:529)

-----

Have seen this on both Linux and Windows XP RCP apps.

Reproducible: Always

Steps to Reproduce:
1. Create a ECore model.
2. Use a model instance as ECore DataSource and create a BIRT report using ECore DataSet.
3. In Navigator View, select the report and from the pull down > Report > Run Report
Comment 1 John Conlon CLA 2011-09-28 17:02:57 EDT
Created attachment 204226 [details]
ReportViewer Error with stack
Comment 2 Kenn Hussey CLA 2011-09-29 09:10:28 EDT
Silly question, but have you confirmed whether the class is included in the BIRT engine's class loading path? Other clients have used the dataset in RCP applications without issues...
Comment 3 John Conlon CLA 2011-09-29 12:59:56 EDT
(In reply to comment #2)
> Silly question, but have you confirmed whether the class is included in the
> BIRT engine's class loading path? Other clients have used the dataset in RCP
> applications without issues...

No, it's a good question. Have previously worked with the interim org.eclipse.datatools.enablement.oda.ecore Drivers that did not require the users to add any driver or model jars to the Report Execution path.  

And yes, to avoid this error it is necessary (like the message suggests) to add the org.eclipse.emf.oda.ecore to the Report Execution path in the Report Design user preferences.  Also one must add and all the model plugins that are used in the report or the user will see a similar error.

Like the previous interim driver, is there a way to avoid requiring a user of an RCP EMF/BIRT app to manually configure the driver by setting the paths to what could be more than a handful of jars?
Comment 4 Kenn Hussey CLA 2011-10-03 10:52:01 EDT
Hmm, I'm not that familiar with the other driver (it was developed by the Data Tools team), but I'll look into it and see what we can do...
Comment 5 John Conlon CLA 2011-12-22 17:10:32 EST
Have discovered this bug is more subtle than I have described. 

The appearance of this error message depends on the model, the dataset, and the bindings of report items to certain columns of the dataset.  

1. In the report if the Data Type in the Data Column Bindings are simple types than the report can be run without the org.eclipse.emf.oda.ecore jar on the classpath.  

2. However if the Data Type in the Data Column Bindings are Java Object, then the org.eclipse.emf.oda jar needs to be on the classpath.

3. If the Java Object is an  EMF model specific EEnumerator the model jar also needs to be on the classpath.

This is reproducible with the Extended Library model. 

Steps:

---------- Simple data types -----------
1. Create a extlibrary model instance document with a Library as the root element.

2. On the Library document set something for the name and an address properties. (thats all you will need)

3. Create a blank report and add a datasource pointing to the model instance document and a dataset with the values:
	Context Type: 	extlibrary.Library
	Query Text:	self
	Result Type:	extlibrary.Library
Note the data types of the Output columns.  The only two that are not Objects are Strings -  name and address. 

4. Add a two column table to the report, and add the name and address columns from the dataset to each of the report columns.  (The table bindings should only have listings for these two.)

5. With NO CLASSPATH Settings, Run the report and it should display in the browser with NO ERRORS.  

---------- Java Object data type -----------

6. Add a binding to the table to the dataset books column.  No need to change the appearance of the table a binding to books is enough.

8. With NO CLASSPATH Settings, Run the report. It should display ERRORS in the browser.

 -> A report document error occurred when loading: Result Data.
Failed to load class "org.eclipse.emf.oda.ecore.impl.ResultSet$JavaObject" for "EJavaObject" type column "books". 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:9) 

9. In the User Preference Report Design Classpath Add a reference to the org.eclipse.emf.oda.ecore.ecore (You will have to find it in the plugins directory)  Run the report and it should display in the browser with NO ERRORS.  

---------- Java Object is a EEnumerator -----------
10. Add a book to the model document.

11. Create a new dataset to retrieve all the books:
	Context Type: 	extlibrary.Library
	Query Text:	books
	Result Type:	extlibrary.Book
12. Delete old table and add a new one for books. (Just drag the whole books dataset to the report)

13. Run the report:
 -> A report document error occurred when loading: Result Data.
Failed to load class "org.eclipse.emf.examples.extlibrary.BookCategory" for "EEnumerator" type column "category". please make sure class "org.eclipse.emf.examples.extlibrary.BookCategory" is included in BIRT engines class loading path.
org.eclipse.emf.examples.extlibrary.BookCategory (Element ID:132)

14. To get rid of this error you will have to add the org.eclipse.emf.examples.extlibrary jar to the classpath
Comment 6 John Conlon CLA 2011-12-22 17:14:06 EST
Note, that I also started a BIRT mailist discussion on this issue:
http://www.eclipse.org/forums/index.php/m/765227/
Comment 7 Ed Merks CLA 2012-04-02 10:30:26 EDT
Looking at the long discussion thread, I wonder if there is really a problem with EMF's ODA driver or if this purely a classpath problem with BIRT?
Comment 8 John Conlon CLA 2012-04-03 14:57:34 EDT
At the request of Jason Weathersby I have opened up a BIRT
https://bugs.eclipse.org/bugs/post_bug.cgi that references this one.
Comment 9 John Conlon CLA 2012-04-03 14:59:28 EDT
Let's try that again.  Here is the new BIRT
https://bugs.eclipse.org/bugs/show_bug.cgi?id=375995
Comment 10 Ed Merks CLA 2012-10-05 01:38:22 EDT
I'm not sure there's anything to do here.