Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » instancing a java class
instancing a java class [message #100026] Fri, 16 December 2005 13:14 Go to next message
Eclipse UserFriend
Originally posted by: mateusnovaes.infonet.com.br

IŽm trying to instance a java object in the data set open method, but the
BIRT canŽt access my class.
I put my jar file in the path that are in help.
<ECLIPSE_INSTALL>\plugins\org.eclipse.birt.report.viewer\birt\WEB-INF\lib.
but is still not working.
I try all this commands in the data set open method:
1. var dados = new Packages.br.com.teste.Dados();
2. var dados = new br.com.teste.Dados();
3. importPackage(Packages.br.com.teste);

iŽm guess that Birt canŽt see my classes.
Anyone can help me?

Mateus
Re: instancing a java class [message #100119 is a reply to message #100026] Fri, 16 December 2005 17:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Mateus wrote:
> IŽm trying to instance a java object in the data set open method, but
> the BIRT canŽt access my class.
> I put my jar file in the path that are in help.
> <ECLIPSE_INSTALL>\plugins\org.eclipse.birt.report.viewer\birt\WEB-INF\lib.
> but is still not working.
> I try all this commands in the data set open method:
> 1. var dados = new Packages.br.com.teste.Dados();
> 2. var dados = new br.com.teste.Dados();
> 3. importPackage(Packages.br.com.teste);
>
> iŽm guess that Birt canŽt see my classes. Anyone can help me?
>
> Mateus
>
Did you restart Eclipse after copying the file?
Re: instancing a java class [message #100160 is a reply to message #100119] Fri, 16 December 2005 17:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mateusnovaes.infonet.com.br

Yes, but the error donŽt stop.
I have a jar file dados.jar and inside him 2 files dados.class and
clientes.class, that belong to the package com.teste,
When i instance the class, like this:
var dados = new Packages.com.teste.Dados();
i get this error:

A Birt exception occurred.
Plug-in Provider:Eclipse.org
Plug-in Name:BIRT Data Engine
Plug-in ID:org.eclipse.birt.data
Version:1.0.1
Error Code:data.engine.JSScriptInvalid
Error Message:Invalid Javascript expression. Source: DataSet:Data
Set.open, line: 0, Expression:
function_prefix_1134753623511();function
function_prefix_1134753623511(){var dados = new Packages.com.teste.Dados();
var i = dados.getIterator();}
Script engine error: TypeError: [JavaPackage com.teste.Dados] is not a
function.

Do you have any ideia?
Thsnks,
Mateus
Re: instancing a java class [message #100174 is a reply to message #100160] Fri, 16 December 2005 21:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

I don't see anything wrong. Sounds and looks right.

Do you see package paths in the jar? In other words, if you open the
jar as a zip do you see com/teste in the path column?



Mateus wrote:
> Yes, but the error donŽt stop. I have a jar file dados.jar and inside
> him 2 files dados.class and clientes.class, that belong to the package
> com.teste,
> When i instance the class, like this:
> var dados = new Packages.com.teste.Dados();
> i get this error:
>
> A Birt exception occurred.
> Plug-in Provider:Eclipse.org
> Plug-in Name:BIRT Data Engine
> Plug-in ID:org.eclipse.birt.data
> Version:1.0.1
> Error Code:data.engine.JSScriptInvalid
> Error Message:Invalid Javascript expression. Source: DataSet:Data
> Set.open, line: 0, Expression:
> function_prefix_1134753623511();function
> function_prefix_1134753623511(){var dados = new Packages.com.teste.Dados();
> var i = dados.getIterator();}
> Script engine error: TypeError: [JavaPackage com.teste.Dados] is not a
> function.
>
> Do you have any ideia?
> Thsnks,
> Mateus
>
Re: instancing a java class [message #100284 is a reply to message #100160] Mon, 19 December 2005 00:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Does your class access any other Jars that may not be in the classpath?
Drop the var if you use this class in the fetch method.

Jason Weathersby
BIRT PMC
Re: instancing a java class [message #100461 is a reply to message #100174] Mon, 19 December 2005 07:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mateaju.yahoo.com.br

Yes, the class in jar file has the path com/teste. My class donŽt have
imports.
Can anyone send me a example that work?
The commands that i should put in script and the jar file if possible.
Send me to this e-mail: mateaju@ig.com.br
Instancing a java class in birt is extreme important to me.
Thanks,
Mateus
Re: instancing a java class [message #100529 is a reply to message #100461] Mon, 19 December 2005 23:31 Go to previous message
Ady Das-OToole is currently offline Ady Das-OTooleFriend
Messages: 7
Registered: July 2009
Junior Member
Mateus wrote:
> Yes, the class in jar file has the path com/teste. My class donŽt have
> imports. Can anyone send me a example that work? The commands that i
> should put in script and the jar file if possible. Send me to this
> e-mail: mateaju@ig.com.br
> Instancing a java class in birt is extreme important to me.
> Thanks,
> Mateus
>
>

Add the Packages keyword in your script. See example below:

function beforeDrawSeries(series, renderer){
var m = series.getMarker();
var markerMod = new
Packages.org.eclipse.birt.report.viewer.utilities.MarkerModi fier();
var m2 = markerMod.modifyMarker(m,5);
}
Previous Topic:newbie question -- simple report
Next Topic:Problems with exceptions
Goto Forum:
  


Current Time: Wed Jan 15 11:17:16 GMT 2025

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

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

Back to the top