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

Bug 368636

Summary: Report Viewer previews scripted Jersey Client data only first time
Product: z_Archived Reporter: Paul Smith <paul.t.smith>
Component: BIRTAssignee: Birt-ReportViewer <Birt-ReportViewer-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: bluesoldier
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Test Eclipse Report with Scripted Datasource to access Restful service wrapper none

Description Paul Smith CLA 2012-01-16 00:27:09 EST
Build Identifier: Version: Indigo Service Release 1 Build id: 20110916-0149

I have a very simple report that uses a scripted data source to access a data sourced class. The class is simple Jersey wrapper class that accesses a Restful service. The report executes correctly within the report viewer preview correctly only the first time. Any subsequent execution fails with the following until Eclipse is restarted. 


Caused by: java.lang.LinkageError: ClassCastException: attempting to castnulltojar:file:/C:/Java/Frameworks/Jersey/jersey-archive-1.11/lib/jersey-core-1.11.jar!/javax/ws/rs/ext/RuntimeDelegate.class
	at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:116)
	at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:91)
	at com.sun.jersey.api.client.ClientRequest.<clinit>(ClientRequest.java:215)
	at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)
	at au.com.intelligentpathways.service.restful.mock.TaxInvoiceDataWrapper.getTaxInvoiceData(TaxInvoiceDataWrapper.java:33)
	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.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
	at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:86)
	at org.mozilla.javascript.gen.c11._c0(/report/method[@name="onPrepare"]:5)
	at org.mozilla.javascript.gen.c11.call(/report/method[@name="onPrepare"])
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
	at org.mozilla.javascript.gen.c11.call(/report/method[@name="onPrepare"])
	at org.mozilla.javascript.gen.c11.exec(/report/method[@name="onPrepare"])
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
	... 63 more


The report executes correctly every time if deployed to BIRT running on Glassfish.

Reproducible: Always

Steps to Reproduce:
1.Create a simple Java JAX-RS Jersey client to access a RESTFul service
2.Create a report with a scripted data source to access the Java POJO and populate some fields on the report.
3.Set the report runtime classpath to include all the Jersey 1.11 jar files and the Java POJO wrapper class created in 1.
4.Preview the report. It should work correctly the first time. Refresh the report and you will see the ClassCastException.

A test project can be provided upon request.
Comment 1 Paul Smith CLA 2012-01-16 00:32:18 EST
Created attachment 209519 [details]
Test Eclipse Report with Scripted Datasource to access Restful service wrapper
Comment 2 Xiaoying Gu CLA 2012-08-01 04:32:54 EDT
(In reply to comment #1)
> Created attachment 209519 [details]
> Test Eclipse Report with Scripted Datasource to access Restful service
> wrapper

How can I build up the Restful service on my local machine?