Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Newby to BIRT
Newby to BIRT [message #489913] Tue, 06 October 2009 13:28 Go to next message
No real name is currently offline No real nameFriend
Messages: 7
Registered: October 2009
Junior Member
Hi all,

I started to try out Birt in favor of Itext.

I made a report and connected it to my running hsqldb

Connection test was: OK

Now i made a test report, just printing some lines from a table in my db.

Te result was wat I expected and was the same as in the preview !

But i still get some sever exception when i run my code :

6-okt-2009 15:16:02 org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: DriverClassLoader failed to load class: org.hsqldb.jdbcDriver
java.lang.ClassNotFoundException: org.hsqldb.jdbcDriver
at org.eclipse.birt.core.framework.URLClassLoader.findClass1(UR LClassLoader.java:185)
at org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClas sLoader.java:154)
at org.eclipse.birt.core.framework.URLClassLoader$1.run(URLClas sLoader.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.birt.core.framework.URLClassLoader.findClass(URL ClassLoader.java:149)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.load ExtraDriver(JDBCDriverManager.java:919)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.find Driver(JDBCDriverManager.java:738)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.regi sterDriver(JDBCDriverManager.java:879)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.load AndRegisterDriver(JDBCDriverManager.java:862)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doCo nnect(JDBCDriverManager.java:246)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getC onnection(JDBCDriverManager.java:212)
at org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUr l(Connection.java:234)
at org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connec tion.java:160)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaCo nnection.open(OdaConnection.java:238)
at org.eclipse.birt.data.engine.odaconsumer.ConnectionManager.o penConnection(ConnectionManager.java:180)
at org.eclipse.birt.data.engine.executor.DataSource.newConnecti on(DataSource.java:193)
at org.eclipse.birt.data.engine.executor.DataSource.open(DataSo urce.java:181)
at org.eclipse.birt.data.engine.impl.DataSourceRuntime.openOdiD ataSource(DataSourceRuntime.java:209)
at org.eclipse.birt.data.engine.impl.QueryExecutor.openDataSour ce(QueryExecutor.java:396)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecu tion(QueryExecutor.java:315)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(Pr eparedQuery.java:448)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.pr oduceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.ex ecute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute (PreparedOdaDSQuery.java:144)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSession Impl.execute(DataRequestSessionImpl.java:511)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExec uteQuery(DteDataEngine.java:139)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.e xecute(AbstractDataEngine.java:254)
at org.eclipse.birt.report.engine.executor.ExecutionContext.exe cuteQuery(ExecutionContext.java:1818)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.ex ecuteQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.ListItemExecutor.exe cute(ListItemExecutor.java:66)
at org.eclipse.birt.report.engine.internal.executor.dup.Suppres sDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor .java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.Wrappe dReportItemExecutor.execute(WrappedReportItemExecutor.java:4 6)
at org.eclipse.birt.report.engine.internal.executor.l18n.Locali zedReportItemExecutor.execute(LocalizedReportItemExecutor.ja va:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStacking LM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout (HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:99)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:170)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:75)
at birt.ExecuteReport.executeReport(ExecuteReport.java:40)
at birt.BirtTestUsage.main(BirtTestUsage.java:7)
6-okt-2009 15:16:02 org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: refreshUrlsWhenFail: true
6-okt-2009 15:16:02 org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: driverClassPath: null
6-okt-2009 15:16:02 org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager loadExtraDriver
SEVERE: Registered URLs:


code that i ran:

public void executeReport() throws EngineException {

IReportEngine engine = null;
EngineConfig config = null;

try {
config = new EngineConfig();
config
.setBIRTHome(" C:\\Users\\javadev\\Desktop\\birt-runtime-2_5_1\\ReportEngin e ");
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_E NGINE_FACTORY);
engine = factory.createReportEngine(config);

IReportRunnable design = null;
design = engine
.openReportDesign("src/test/java/birt/reports/secondTry.rptdesign ");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);

PDFRenderOption options = new PDFRenderOption();
options
.setOutputFileName("c:/Users/javadev/Desktop/tempbirt/test2.pdf ");

options.setOutputFormat("pdf");

task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
} catch (Exception ex) {
System.out.println("Error in executeReport : ");
ex.printStackTrace();
} finally {
Platform.shutdown();
}
}



You might notice it's the example code from the wiki.

So i don't know what i'm doing wrong, since there were no errors making the preview and the result is fine, because i get a pdf file with the data :s

Could someone please help.
Re: Newby to BIRT [message #490047 is a reply to message #489913] Wed, 07 October 2009 05:13 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This error:
DriverClassLoader failed to load class: org.hsqldb.jdbcDriver

indicates that the driver jar is not in the
birt-runtime-2_5_1\ReportEngine\plugins\org.eclipse.birt.rep ort.data.oda.jdbc_2.5.1.v20090821\drivers

directory. Can you copy it there? You can also alter your code to pass in the path like:

config.getAppContext().put("OdaJDBCDriverClassPath", "c:/birt/mysql/mysql-connector-java-5.0.4-bin.jar");

Jason
Re: Newby to BIRT [message #490059 is a reply to message #489913] Wed, 07 October 2009 06:48 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 7
Registered: October 2009
Junior Member
Thx a lot, the errors are gone Smile
Re: Newby to BIRT [message #657736 is a reply to message #490047] Thu, 03 March 2011 18:34 Go to previous messageGo to next message
anna.w.teittinen is currently offline anna.w.teittinenFriend
Messages: 23
Registered: February 2011
Junior Member
Thank you Jason. I also encountered the same problem but using Oracle 10g XE (for learning). I had added the following to my classpath when running my stand alone Java app:

C:\software\birtruntime\birt-runtime-2_6_2\ReportEngine\lib\ *.jar

C:\software\oracle10gExpressEdition\app\oracle\product\10.2. 0\server\jdbc\lib\ojdbc14.jar


My stand alone app did generate the pdf file but got the same error:

DriverClassLoader failed to load class: oracle.jdbc.OracleDriver

I then proceeded to add the following to the java code, as you suggested in your post:

config.getAppContext().put("OdaJDBCDriverClassPath", " C:\\software\\oracle10gExpressEdition\\app\\oracle\\product\ \10.2.0\\server\\jdbc\\lib\\ojdbc14.jar ");

The errors are gone too!

Thanks again!
--Anna
Re: Newby to BIRT [message #677006 is a reply to message #657736] Tue, 07 June 2011 10:00 Go to previous messageGo to next message
jeyinul  is currently offline jeyinul Friend
Messages: 60
Registered: June 2011
Member
hi,

can you please say where i have to paste the code i.e which program

Please help
Re: Newby to BIRT [message #677014 is a reply to message #657736] Tue, 07 June 2011 10:28 Go to previous messageGo to next message
jeyinul  is currently offline jeyinul Friend
Messages: 60
Registered: June 2011
Member
in which program or where i have to add

"config.getAppContext().put("OdaJDBCDriverClassPath", " C:\\software\\oracle10gExpressEdition\\app\\oracle\\product\ \10.2.0\\server\\jdbc\\lib\\ojdbc14.jar ");"


Plz explain
Re: Newby to BIRT [message #677188 is a reply to message #677014] Tue, 07 June 2011 16:43 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If you are using the RE API add it when you create the engine config.

eg

EngineConfig config = new EngineConfig();
config.getAppContext()......

If you are using the viewer you can add it to either the beforeFactory
script or the beforeOpen of the datasource. Just put it in like:

reportContext.getAppContext().put("OdaJDBCDriverClassPath",
"C:\\software\\oracle10gExpressEdition\\app\\oracle\\product\
\10.2.0\\server\\jdbc\\lib\\ojdbc14.jar");

Jason


On 6/7/2011 6:28 AM, jeyinul wrote:
> in which program or where i have to add
> "config.getAppContext().put("OdaJDBCDriverClassPath", "
> C:\\software\\oracle10gExpressEdition\\app\\oracle\\product\
> \10.2.0\\server\\jdbc\\lib\\ojdbc14.jar ");"
>
>
> Plz explain
Previous Topic:Choosing the OS
Next Topic:How to dynamically set the grouping range value for a table?
Goto Forum:
  


Current Time: Tue Apr 23 15:57:27 GMT 2024

Powered by FUDForum. Page generated in 0.04284 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top