Scripted DataSet classpath question [message #643451] |
Mon, 06 December 2010 22:25 |
Jim Garrison Messages: 57 Registered: July 2009 |
Member |
|
|
I have a simple Scripted Data set project that works when the DAO class returns hard-coded objects. When I try to use JDBC to retrieve data from Oracle, I get a ClassNotFound exception for the Oracle driver.
The project is set up as a Java project with a rptdesign file and the JDBC jar in the build path. I can run the DAO from a main method with no problems, but when it is invoked from BIRT's Javascript it appears the classpath does not contain the libraries I have set up in the Java project's build path.
Where else do I need to add a reference to the JDBC jar?
EDIT: I found the answer. Moderator, please delete this question.
[Updated on: Mon, 06 December 2010 22:40] Report message to a moderator
|
|
|
Re: Scripted DataSet classpath question [message #643461 is a reply to message #643451] |
Mon, 06 December 2010 22:34 |
|
Jim
Can you set a report project and then reference your Java project as
described here:
http://birtworld.blogspot.com/2009/12/birt-designer-classpat h-changes.html
Jason
On 12/6/2010 5:25 PM, Jim Garrison wrote:
> I have a simple Scripted Data set project that works when the DAO class
> returns hard-coded objects. When I try to use JDBC to retrieve data from
> Oracle, I get a ClassNotFound exception for the Oracle driver.
>
> The project is set up as a Java project with a rptdesign file and the
> JDBC jar in the build path. I can run the DAO from a main method with no
> problems, but when it is invoked from BIRT's Javascript it appears the
> classpath does not contain the libraries I have set up in the Java
> project's build path.
>
> Where else do I need to add a reference to the JDBC jar?
|
|
|
|
Re: Scripted DataSet classpath question [message #643622 is a reply to message #643595] |
Tue, 07 December 2010 16:09 |
|
In my previous post I meant to say create a report project. Do you have
two projects in the workspace? one for the java project and one for birt?
Jason
On 12/7/2010 10:43 AM, Jim Garrison wrote:
> I just tried this and it had no effect. I'm still getting the same errors
|
|
|
|
Re: Scripted DataSet classpath question [message #643652 is a reply to message #643451] |
Tue, 07 December 2010 18:25 |
Jim Garrison Messages: 57 Registered: July 2009 |
Member |
|
|
I found the root of all the problems. As of 2.5.2, the report designer classpath is set in a preferences page. Unfortunately, even though the dialog allows you to use Classpath Variables, that functionality does not work. I have submitted a bug.
If you add an entry based on a workspace-defined variable, the entry appears to be ignored with no error messages.
If you add a dependency to another project in the workspace that exports libraries based on variables, the paths with variables are interpreted relative to the Eclipse installation path, with the variable name taken literally, leading to gobs of FileNotFoundExceptions each time you try to run a report.
If however you add references to external jars, with explicit absolute paths, then it works.
Along with the introduction of the Report Design Classpath preference, BIRT was also changed to NOT look in the birt/scriptlib directory of the Report Viewer plugin (which is the recommended location in http://wiki.eclipse.org/BIRT/FAQ/Scripting.
|
|
|
Re: Scripted DataSet classpath question [message #643694 is a reply to message #643652] |
Tue, 07 December 2010 21:53 |
|
Jim,
Thanks for posting. In the deployed environment the scriptlib directory
should still work. I will update the wiki
Jason
On 12/7/2010 1:25 PM, Jim Garrison wrote:
> I found the root of all the problems. As of 2.5.2, the report designer
> classpath is set in a preferences page. Unfortunately, even though the
> dialog allows you to use Classpath Variables, that functionality does
> not work. I have submitted a
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=332056
>
> If you add an entry based on a workspace-defined variable, the entry
> appears to be ignored with no error messages.
> If you add a dependency to another project in the workspace that exports
> libraries based on variables, the paths with variables are interpreted
> relative to the Eclipse installation path, with the variable name taken
> literally, leading to gobs of FileNotFoundExceptions each time you try
> to run a report.
>
> If however you add references to external jars, with explicit absolute
> paths, then it works.
>
> Along with the introduction of the Report Design Classpath preference,
> BIRT was also changed to NOT look in the birt/scriptlib directory of the
> Report Viewer plugin (which is the recommended location in
> http://wiki.eclipse.org/BIRT/FAQ/Scripting
|
|
|
Re: Scripted DataSet classpath question [message #643884 is a reply to message #643694] |
Wed, 08 December 2010 15:42 |
Jim Garrison Messages: 57 Registered: July 2009 |
Member |
|
|
Jason Weathersby wrote on Tue, 07 December 2010 16:53 | Jim,
Thanks for posting. In the deployed environment the scriptlib directory
should still work. I will update the wiki
Jason
|
Hmmm... I'm positive that I couldn't get it to work when I put the JDBC jars in birt/scriptlib. There could be something else wrong.
I edited the Wiki to add a comment explaining my findings but didn't change any existing text.
[Updated on: Wed, 08 December 2010 15:43] Report message to a moderator
|
|
|
Re: Scripted DataSet classpath question [message #643908 is a reply to message #643884] |
Wed, 08 December 2010 16:33 |
|
Jim,
Was the driver jar located elsewhere in the cp?
The scriptlib directory is the jar location for the deployed web-viewer
and should work.
Jason
On 12/8/2010 10:42 AM, Jim Garrison wrote:
> Jason Weathersby wrote on Tue, 07 December 2010 16:53
>> Jim,
>>
>> Thanks for posting. In the deployed environment the scriptlib
>> directory should still work. I will update the wiki
>>
>> Jason
>
>
> Hmmm... I'm positive that I couldn't get it to work when I put the JDBC
> jars in birt/scriptlib. There could be something else wrong.
|
|
|
Powered by
FUDForum. Page generated in 0.03649 seconds