I am in the process of upgrading from 2.0.1 to 2.3 version. I copied all the plugins and lib files that came with BIRT 2.3 runtime into appropriate directories in my application. As per the requirement I copied the jar file that holds the driver into birtpluginsorg.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610drivers directory. I can see the report generation work properly and the graphs displayed in html format. I can also see the report in excel worksheet. The issue is with the pdf format.<br />
<br />
The data source is a custom class (ResultsManager)that holds the data and is accessed by our own driver(EADriver). The results manager gets populated when the user queries the database with the user session information. In the older version BIRT used to load the EADriver and get the data from the ResultsManager as it was running within the same class loader. In the current version it is starting its own class loader and creating its own version of ResultsManager (which is empty) and not access the ResultsManager that holds the actual data.<br />
<br />
After reading through the forums I realized others are facing similar issue. As stated in <a class='bbc_url' href='
http://www.birt-exchange.com/forum/eclipse-birt-newsgroup-mirror/11150-setting-parent_classloader-birt-2-3-a.html'>http://www.birt-exchange.com/forum/eclipse-birt-newsgroup-mirror/11150-setting-parent_classloader-birt-2-3-a.html</a>, I did try to set the PARENT_CLASSLOADER without any success. Here is the code:<br />
<br />
<code><br />
m_config = new EngineConfig( );<br />
<br />
if (EclipseUtilities.isRunningEclipse())<br />
{<br />
m_config.setEngineHome(EclipseUtilities.getInstallLocation());<br />
}<br />
else<br />
{<br />
m_config.setEngineHome("./birt");<br />
}<br />
<br />
HashMap mh = (HashMap)m_config.getAppContext();<br />
mh.put("PARENT_CLASSLOADER", ReportingCoordinator.class.getClassLoader());<br />
m_config.setAppContext(mh);<br />
<br />
// Set up the configuration to write images or charts embedded in HTML output.<br />
HTMLRenderOption hc = new HTMLRenderOption( ); <br />
m_config.setEmitterConfiguration( HTMLRenderOption.OUTPUT_FORMAT_HTML, hc ); <br />
<br />
try{<br />
org.eclipse.birt.core.framework.Platform.startup(m_config);<br />
} catch (BirtException be){<br />
<br />
}<br />
// Start the engine<br />
m_engine = new ReportEngine( m_config );<br />
</code><br />
<br />
Is there anyway we can prevent BIRT for loading its own classloader? I see that in RunandRenderTask.run() there is a call to switchToOsgiClassLoader(). Is there a way we can tell BIRT to look at the already loaded driver by setting configuration parameters?<br />
<br />
I appreciate any help in solving this issue. Please let me know if you need more information.<br />
<br />
TIA,<br />
<br />
- Srinivas