Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to publish Java event handlers in JAR files
rpomeroy
Hello,
I have created a Java event handler (overloading fetch) to access SQL data from a scripted data set. I have succeeded in doing this in Eclipse and I am able to run the report by clicking the ?Preview? tab in Eclipse. The BIRT report is in one Eclipse project and the Java code is in another Eclipse project.
Unfortunately I have not been able to figure out how to run this report from iServer Express. I have used instructions from the book ?Integrating and Extending BIRT? and well as documents from this website. (?Overview - Publish BIRT Resources to Iserver Express? and ?Overview ? Publish Reoprts to iServer Express?). I have published the report and the JAR file containing the event handler class to iServer Express in multiple locations with multiple methods, but I always get the error message ?Unhandled exception when executing report?.
Is there a document that gives a specific example of loading a Java resource JAR file (not Java script)? I would greatly appreciate any guidance you could provide. I think I need an example with very specific instructions.
Thanks,
rpomeroy
Find more posts tagged with
Comments
averma
Hi rpomeroy,
Here is a link to devshare article that talks about how to make this happen:
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/800-deploying-java-classes-used-in-birt-reports/
Let me know if that solves your issue.
Ashwini
dzish
Maybe it is not answer for your answer. But it can help to anyone else.<br />
<br />
I build our Reporting portal by Maven. So I used maven for creating jar.<br />
<br />
1.to "dependencies" section I added all necessary libraries used by event handlers. For my projest is:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'><dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>engineapi</artifactId>
<version>${birt.runtime.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>coreapi</artifactId>
<version>${birt.runtime.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>modelapi</artifactId>
<version>${birt.runtime.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>modelodaapi</artifactId>
<version>${birt.runtime.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>scriptapi</artifactId>
<version>${birt.runtime.version}</version>
</dependency>
</pre>
<br />
2. to "plugins" section I added<br />
<pre class='_prettyXprint _lang-auto _linenums:0'><plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!-- library of adapters and other classes must be in "scriptlib" directory -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir="target/MyReportingPortal/scriptlib"/>
<jar destfile="target/MyReportingPortal/scriptlib/MyReportingPortal.jar" basedir="target/classes"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin></pre>
<br />
And birt libraries must be mavenized in your repository.