|
Re: Importing .jar files into BIRT [message #803695 is a reply to message #803330] |
Tue, 21 February 2012 17:06 |
|
Take a look at this:
http://birtworld.blogspot.com/2009/12/birt-designer-classpath-changes.html
That post shows the preference to use in the designer. You can also
click on resources for the report and add a jar there, but the jar will
have to be available in the resource folder in the designer and deployed
viewer
If you added the jar to the designer classpath,
when you deploy the report to the viewer (3.7 or >) just put the jar in
the web-inf/lib.
Jason
On 2/21/2012 2:43 AM, andrew smith wrote:
> Hi, all:
>
> I hope this post finds you all well. What is the best way to include
> .jar files into BIRT project thus making its classes visible to the scipt?
> I have some logic contained in Java .jar files ie bunch of data
> processing classes that I would like to invoke through BIRT. They all
> work flawlessly in Java. I ran them in pure Java, Matlab, Netbeans, etc.
>
> I use the importPackage command:
> importPackage(Packages.database.connectors.jdbc.MsSQLserver);
>
> however, I get the following message:
>
> Function importPackage must be called with a package; had "[JavaClass
> database.connectors.jdbc.MsSQLserver]" instead.
> (/report/method[@name="initialize"]#1)
>
> I added .jar file already as an external JAR
> (ProjectProperies->Classpath ). Also I tried sticking it in the
> /WEB-INF/lib folder as well as using the Import Wizard. Same error
> prevails...
>
> What am I doing wrong?
>
> Thank you,
> Andrew
|
|
|
|
Re: Importing .jar files into BIRT [message #803906 is a reply to message #803870] |
Wed, 22 February 2012 00:45 |
|
Adding a class folder only works for folders that contain classes not
jars I believe. Take a look at the attached workspace. Unzip it and
open the workspace in Eclipse. I have two projects in it that show how
to include a simple jar with the following code:
package my.simple.example;
public class TestClass {
private String testString="My String";
public String getTestString() {
return testString;
}
public void setTestString(String testString) {
this.testString = testString;
}
}
When you look at the preferences be sure to click on the configure
project specific configuration link. One shows how to include the jar
using the classpath preference and the other shows how to include a jar
in the resource folder.
Jason
On 2/21/2012 6:28 PM, andrew smith wrote:
> Hello Jason,
> Thank you for your advice. Let me go over the items just to make sure I
> understand
>
> 1) Followed the instructions at
> birtworld.blogspot.com/2009/12/birt-designer-classpath-changes.html. I
> created a custom folder for all of my .jar files and placed the path to
> the folder using the PROJECT PROPERTIES->CLASSPATH
> Result: the class is not being imported
>
> 2) I placed the .jar file directly into the /WEB-INF/lib folder.
> Result: the class is not being imported
>
> 3) Imported .jar file through the resources window.
> Result: the class is not being imported
>
> I am almost certain that the error that I am making is so trivial, that
> I can not seem to find it. Is there a 'sure' way to import java classes
> into BIRT? What am I doing wrong?
> Thanks,
> Andrew
|
|
|
|
Powered by
FUDForum. Page generated in 0.02670 seconds