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

Bug 311507

Summary: InvocationTargetException when switching to Preview Results
Product: z_Archived Reporter: Gergo Olah <gergo_olah>
Component: BIRTAssignee: Xiaoxiao Wu <xwu>
Status: VERIFIED FIXED QA Contact: Tianli Zhang <tzhang>
Severity: major    
Priority: P3 CC: cchen, mwu, zqian
Version: 2.5.2   
Target Milestone: 2.6.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: Non-Auto

Description Gergo Olah CLA 2010-05-04 06:11:15 EDT
Build Identifier: 20100218-1602

InvocationTargetException occurs when editing a DataSet (to which the DataSource has property binding) and switching to Preview Results. The real exception is SWTException(Invalid thread access) in ReportPropertySheetPage (elementChanged function).

Possible resolution (asynchExec):

public void elementChanged( DesignElementHandle focus, NotificationEvent ev )
{
if ( !viewer.getTree( ).isDisposed( ) )
	{
	PlatformUI.getWorkbench().getDisplay().asynchExec(){new Runnable() {
		public void run() {
		refresh( );
		}
	});

	}


Reproducible: Always

Steps to Reproduce:
1. Create a new Report Design
2. Create a new XML Data Source (e.g. based on library.xml)
3. Create a new ReportParameter (name: XMLfile, type: String)
4. Bind this XMLfile ReportParameter to "XML Data Source File" property in the DataSource Editor
5. Create a new XMLDataSet 
6. Open Properties View
7. Edit the DataSet
8. Open the DataSet (double click on it in Data Explorer)
9. Switch to Preview Results => Exception
Comment 1 Chen Chao CLA 2010-05-17 05:38:19 EDT
In the ResultSetPreviewPage, the dataset preview operation is in a thread, so dte should use Display.getDefault.syncExec( ) method to wrap the code related GUI.
Comment 2 Chen Chao CLA 2010-05-17 05:40:08 EDT
Reassign it to dte.
Comment 3 Xiaoxiao Wu CLA 2010-05-20 23:13:51 EDT
DtE modified the codes to use Display.getDefault.syncExec( ) method to wrap the code related GUI.

So this bug has been fixed.
Comment 4 Tianli Zhang CLA 2010-05-24 23:21:30 EDT
Can not reproduce in 2.6.0.v20100525-0630