DataSetEventHandler and ClassNotFoundException [message #253866] |
Wed, 29 August 2007 13:08  |
Eclipse User |
|
|
|
Originally posted by: cato.ervik-it.no
Hi,
I'm using the Eclipse V3.3.0 and BIRT Report Designer V2.2.0 to implement
a ScriptedDataSet and a DataSetEventHandler which will use our existing
framework for persistence and business logic to fetch data. The problem is
that I keep getting ClassNotFoundException and NoClassDefFoundExceptions
when trying to preview the report. I'm 99% sure that the classnames are
correct and that they exist in the default output folder for my eclipse
project.
After searching this newsgroup and on the internet in general, it seems
that there are two methods which are supposed to help fix this, none which
solves my problem 100%:
1. Add the classes to
plugins\org.eclipse.birt.report.viewer_x.x.x\birt\WEB-INF\cl asses
2. Set the EngineConstants.APPCONTEXT_CLASSLOADER_KEY context property
The first approach fails with a NoClassDefFoundException as my
ScriptedDataSource tries to use our existing framework which seems to not
be accessible from the report viewer. The second one I guess mostly
relates to people integrating the report viewer, don't know if this can be
set in any property files or similar?
Is it possible to make the report-viewer plugin load classes from the
default output folder and jars in the build path in eclipse?
|
|
|
|
Re: DataSetEventHandler and ClassNotFoundException [message #254192 is a reply to message #253952] |
Mon, 03 September 2007 04:59  |
Eclipse User |
|
|
|
Originally posted by: cato.ervik-it.no
Thanks for the answer, that helped us a lot figuring out which options we
have. As we need to load both the ScriptedDataSource classes and the
depending framework in both the report designer (at design-time) and the
webapp (runtime), we will probably publish a few webservices which can be
used by the report-designer and engine. Do you have any experiences with
this approach?
Do you know if there are any plans to improve the classloading features in
the next version?
Best regards,
Cato
surya wrote:
> Hello
> you have two solutions for the above problem.
> In my case i was using a java standalone application with BIRT reporting
> API to execute a report and was using scripted data source.
> what is did, i had the Java class which i was accessing in the birt report
> as scripted data source in the same eclipse project.
> 1. u can ste this property before staritng the platform // Option 1
> System.setProperty
> (EngineConstants.WEBAPP_CLASSPATH_KEY,"./myclasses/myjar.jar " );
> u can create jar of ur java clasees and can give that path in this call.
> e.g u can use
> System.setProperty (EngineConstants.WEBAPP_CLASSPATH_KEY,"./bin" ); as
> after building the eclipse will put the class files in the bin
> directory.NOTE: do give the correct packgae info..like if ur class file is
> in bin/org/urpkg/
> the give the appripriate package path.
> or
> 2.
> // Option - MyClass dSrc = new MyClass();
> //runReport is on type IRunAndRenderTask//
> runReport.addScriptableJavaObject("MyJavaScriptItem", dSrc );
> // u can get more info at this place
> http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.p hp
> u have miscellanesous section near the end of the page which will help u
> with the above functioncall. Furthur the above funtion is depricated, so
> u can use theoption that i have given below:
> //You can use the application context object to do this. You can
> set this for the task or the engine like:
> DummyClass dl = new DummyClass();
> Configure the Engine and start the Platform
> config = new EngineConfig( );
> HashMap hm = config.getAppContext();
> hm.put( "dummy", dl);
> config.setAppContext(hm);
> // do these defore starting the platform
> If you still be facing issues do revert back, will try my best to get it
> resolved
> Thanks and Regards
> Surya
|
|
|
Powered by
FUDForum. Page generated in 0.04619 seconds