Home
Analytics
Report with Java Scripted DS on Birt Viewer
evgeny
Hi,
I have created a Birt report with a scripted Data Set in Java and would like to execute the report on a tomcat server. I have already executed reports on tomcat with jdbc connection, but not sure how to deal with the java project. Where to put the files, where the report aso. I also have some properties and logger filies as part of my java project, the structury is like that:
src:
- java classes
referenced libraries:
- jars
reports:
- scripted data set reports
prop.properties
logger.log
Thanks a lot for your help
Evgeny
Find more posts tagged with
Comments
JasonW
You can specify where the jars for the scripted data set are located in the web.xml. By default you can put them in the scriptlib directory of the web viewer app. You can put the report anywhere in the web app. Just prefix the directory in the url to the report with the __report url parameter.<br />
<br />
<a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/deploy/viewerUsage2.2.php'>Using
the BIRT Report Viewer</a><br />
<br />
Jason
evgeny
Hi Jason,
thank you for your help.
I have followed your advices, but with no success. I have put the jar of the project, the jar of the needed classes, the .class files and the bin folder into the scriptlib directory.
When I call the report, tomcat finds the report but is giving me a rather not helpful exception: java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception
This is the whole exception and there is no further details to it.
Birt seems not to find the classes. I have tried to use the log facility of birt, but it just creates empty log files.
Do you have an idea why the birt viewer can't see the classes?
Thank you in advance
Evgeny
JasonW
Evgeny,
Do not export the project as a jar, just the package. Switch to the Java perspective, right click on the package name and export it as a jar to the scriptlib directory. See attached image.
Jason
JasonW
Lets try a jpg :>
evgeny
Hi Jason,
thank you for your reply.
I have tried that already. I have three packages. I tried to export them all together and separated to the scriptlib folder, but still have the same exception.
Thank you for further help
Evgeny
JasonW
In the web.xml there is a setting for the logger. Can you set it to FINEST run the report, zip the log file and upload it?
Jason
evgeny
Hi Jason,
I'm attaching the zip file with the logs. The parameter for BIRT_VIEWER_SCRIPTLIB_DIR is set to WEB-INF/scriptlib. The abd_reporting_ws_src.jar is a jar of the src folder of my project in eclipse. It contains three packages. I have also tried to put the three packages separately, but with no success.
Thank you for your help
Evgeny
JasonW
Is there anychance you could post or email me the code? Can I run your code?
Jason
evgeny
Hi Jason,
after investigating a bit more on this issue I found out, that the problem is not in the execution of the jars. I build a dummy scripted data set and this works.
But originally I am using a scripted data set which calls web services with jax-ws. I just started having a look at this issue, but is it possible that the BIRT Viewer has a problem with jax-ws?
Thank you in advance
Evgeny
JasonW
Thanks keep us posted.