Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Scripted DataSet classpath question
Scripted DataSet classpath question [message #643451] Mon, 06 December 2010 22:25 Go to next message
Jim Garrison is currently offline Jim GarrisonFriend
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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #643595 is a reply to message #643461] Tue, 07 December 2010 15:43 Go to previous messageGo to next message
Jim Garrison is currently offline Jim GarrisonFriend
Messages: 57
Registered: July 2009
Member
I just tried this and it had no effect. I'm still getting the same errors
Re: Scripted DataSet classpath question [message #643622 is a reply to message #643595] Tue, 07 December 2010 16:09 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #643630 is a reply to message #643622] Tue, 07 December 2010 16:53 Go to previous messageGo to next message
Jim Garrison is currently offline Jim GarrisonFriend
Messages: 57
Registered: July 2009
Member
I have a single Java project that contains the DAO and row object code, along with a report definition. The .project file has both a Java nature and a "reportprojectnature".

[Updated on: Tue, 07 December 2010 16:57]

Report message to a moderator

Re: Scripted DataSet classpath question [message #643652 is a reply to message #643451] Tue, 07 December 2010 18:25 Go to previous messageGo to next message
Jim Garrison is currently offline Jim GarrisonFriend
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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 Go to previous messageGo to next message
Jim Garrison is currently offline Jim GarrisonFriend
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 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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.
Previous Topic:BIRT Viewer Problem
Next Topic:PermGen Space Error running BIRT reports
Goto Forum:
  


Current Time: Thu Apr 25 07:37:49 GMT 2024

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

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

Back to the top