Skip to main content



      Home
Home » Archived » BIRT » eng.createRunAndRenderTask
eng.createRunAndRenderTask [message #236775] Thu, 03 May 2007 16:16 Go to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

I am having an issue where I am unable to get past the following in my
java program to create my report using BIRT

task = eng.createRunAndRenderTask(design);

When I display the value of design I get the following

"org.eclipse.birt.report.engine.api.impl.ReportRunnable@1de891b"

The following is my java program....

import java.io.*;
import java.lang.*;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.birt.report.engine.api.*;
import org.eclipse.birt.core.framework.Platform;

public class BIRT {
public static void main(String[] args) {

FileOutputStream out; // declare a file output object
PrintStream p; // declare a print stream object

try
{
// Create a new file output stream
out = new FileOutputStream("myfile.txt",true);

// Connect print stream to the output stream
p = new PrintStream( out );
p.println ("This is written to a file");

// Variables used to control BIRT engine instance
EngineConfig conf = null;
ReportEngine eng = null;
IReportRunnable design = null;
IRunAndRenderTask task = null;
HTMLRenderContext renderContext = null;
HashMap contextMap = null;
HTMLRenderOption options = null;

// Setup the BIRT engine configuration. The Engine Home is hardcoded
// here, this is proably better set in an environment variable or in
// a configuration file. No other options need to be set
conf = new EngineConfig( );
conf.setEngineHome("/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine ");
conf.setLogConfig("/usr/Local", Level.ALL);

// System.out.println("I am here!");
p.println ("I am here");

// Create new Report engine based off of the configuration
eng = new ReportEngine( conf );

// With our new engine, lets try to open the report design
try
{
// System.out.println("I am here!");
p.println ("before design");

design =
eng.openReportDesign("/home/rci/BIRT2/workspace/netrec/netrecloc.rptdesign ");
p.println ("After design");
}

catch (Exception e)
{
p.println ("An error occured during the opening of the report
file!");
//System.err.println("An error occured during the opening of the
report file!");
e.printStackTrace();
System.exit(-1);
}

p.println ("Before assign task");
p.println ("The design is " + design);

// With the file open, create the Run and Render task to run the report
task = eng.createRunAndRenderTask(design);

p.println ("after task");
p.println ("task is " + task);


// Set Render context to handle url and image locations, and apply to
the
// task
renderContext = new HTMLRenderContext();
renderContext.setImageDirectory("image");
contextMap = new HashMap();
contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
renderContext );
task.setAppContext( contextMap );

p.println ("task set appcontext");

// This will set the output file location, the format to render to, and
// apply to the task
options = new HTMLRenderOption();
options.setOutputFileName("/var/www/html/smech/repout/test.html ");
options.setOutputFormat("html");
task.setRenderOption(options);

try
{
p.println ("before task.run");
task.run();
}
catch (Exception e)
{
p.println ("An error occured while running the report!");
//System.err.println("An error occurred while running the report!");
e.printStackTrace();
System.exit(-1);
}

// Destroy the engine and let the garbage collector
// do its thing
p.println ("All went well. Closing program!");
//System.out.println("All went well. Closing program!");
eng.destroy();

p.close();
} // try
catch (Exception eout)
{
System.err.println ("Error writing to file");
} // catch
} // main

} // BIRT


Any suggestions why I can't get past the createRunAndRenderTask , would be
greatly appreciated.
Re: eng.createRunAndRenderTask [message #236780 is a reply to message #236775] Thu, 03 May 2007 18:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

Take a look at this example.
http://wiki.eclipse.org/index.php/Simple_Execute

Also can you post the stack trace?

Jason

Jo-Anne wrote:
> I am having an issue where I am unable to get past the following in my
> java program to create my report using BIRT
>
> task = eng.createRunAndRenderTask(design);
>
> When I display the value of design I get the following
>
> "org.eclipse.birt.report.engine.api.impl.ReportRunnable@1de891b"
>
> The following is my java program....
>
> import java.io.*;
> import java.lang.*;
> import java.util.HashMap;
> import java.util.List;
> import java.util.logging.Level;
> import org.eclipse.birt.report.engine.api.*;
> import org.eclipse.birt.core.framework.Platform;
>
> public class BIRT {
> public static void main(String[] args) {
>
> FileOutputStream out; // declare a file output object
> PrintStream p; // declare a print stream object
>
> try
> {
> // Create a new file output stream
> out = new FileOutputStream("myfile.txt",true);
>
> // Connect print stream to the output stream
> p = new PrintStream( out );
> p.println ("This is written to a file");
>
> // Variables used to control BIRT engine instance
> EngineConfig conf = null;
> ReportEngine eng = null;
> IReportRunnable design = null;
> IRunAndRenderTask task = null;
> HTMLRenderContext renderContext = null;
> HashMap contextMap = null;
> HTMLRenderOption options = null;
>
> // Setup the BIRT engine configuration. The Engine Home is hardcoded
> // here, this is proably better set in an environment variable or in
> // a configuration file. No other options need to be set
> conf = new EngineConfig( );
> conf.setEngineHome("/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine ");
> conf.setLogConfig("/usr/Local", Level.ALL);
>
> // System.out.println("I am here!");
> p.println ("I am here");
>
> // Create new Report engine based off of the configuration
> eng = new ReportEngine( conf );
>
> // With our new engine, lets try to open the report design
> try
> { // System.out.println("I am here!");
> p.println ("before design");
>
> design =
> eng.openReportDesign("/home/rci/BIRT2/workspace/netrec/netrecloc.rptdesign ");
>
> p.println ("After design");
> }
>
> catch (Exception e)
> {
> p.println ("An error occured during the opening of the report file!");
> //System.err.println("An error occured during the opening of the
> report file!");
> e.printStackTrace();
> System.exit(-1);
> }
>
> p.println ("Before assign task");
> p.println ("The design is " + design);
>
> // With the file open, create the Run and Render task to run the report
> task = eng.createRunAndRenderTask(design);
>
> p.println ("after task");
> p.println ("task is " + task);
>
>
> // Set Render context to handle url and image locations, and apply to the
> // task
> renderContext = new HTMLRenderContext();
> renderContext.setImageDirectory("image");
> contextMap = new HashMap();
> contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEX T,
> renderContext );
> task.setAppContext( contextMap );
>
> p.println ("task set appcontext");
>
> // This will set the output file location, the format to render to, and
> // apply to the task
> options = new HTMLRenderOption();
> options.setOutputFileName("/var/www/html/smech/repout/test.html ");
> options.setOutputFormat("html");
> task.setRenderOption(options);
>
> try
> {
> p.println ("before task.run");
> task.run();
> }
> catch (Exception e)
> {
> p.println ("An error occured while running the report!");
> //System.err.println("An error occurred while running the report!");
> e.printStackTrace();
> System.exit(-1);
> }
>
> // Destroy the engine and let the garbage collector
> // do its thing
> p.println ("All went well. Closing program!");
> //System.out.println("All went well. Closing program!");
> eng.destroy();
>
> p.close();
> } // try
> catch (Exception eout)
> {
> System.err.println ("Error writing to file");
> } // catch
> } // main
>
> } // BIRT
>
>
> Any suggestions why I can't get past the createRunAndRenderTask , would
> be greatly appreciated.
>
Re: eng.createRunAndRenderTask [message #237102 is a reply to message #236780] Tue, 08 May 2007 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

This is a portion of my log file from when I run the report.... It's 1926
lines so I didn't put it all on. I'm not sure what I'm doing wrong!


May 3, 2007 3:48:26 PM
org.eclipse.birt.report.engine.api.impl.ReportEngine setu
pScriptScope

INFO: Error occurs while initialze script scope

org.mozilla.javascript.EvaluatorException: Cannot add a property to a
sealed obj
ect. ()

at
org.mozilla.javascript.DefaultErrorReporter.runtimeError(Def aultError
Reporter.java:76)

at
org.mozilla.javascript.Context.reportRuntimeError(Context.ja va:591)
at
org.mozilla.javascript.Context.reportRuntimeError(Context.ja va:630)
at
org.mozilla.javascript.Context.reportRuntimeError0(Context.j ava:600)
at
org.mozilla.javascript.ScriptableObject.addSlot(ScriptableOb ject.java
:1685)

at
org.mozilla.javascript.ScriptableObject.getSlotToSet(Scripta bleObject
java:1647)

at
org.mozilla.javascript.ScriptableObject.put(ScriptableObject .java:247
)

at org.mozilla.javascript.IdScriptable.put(IdScriptable.java:11 1)

at
org.mozilla.javascript.ScriptableObject.defineProperty(Scrip tableObje
ct.java:1077)

at
org.mozilla.javascript.IdScriptable.defineProperty(IdScripta ble.java:
194)

at
org.mozilla.javascript.ScriptableObject.defineProperty(Scrip tableObje
ct.java:1103)

at
org.mozilla.javascript.IdScriptable.addIdFunctionProperty(Id Scriptabl
e.java:451)

at
org.mozilla.javascript.NativeString.fillConstructorPropertie s(NativeS
tring.java:71)

at
org.mozilla.javascript.IdScriptable.addAsPrototype(IdScripta ble.java:
424)

at org.mozilla.javascript.NativeString.init(NativeString.java:5 7)

at
org.mozilla.javascript.Context.initStandardObjects(Context.j ava:703)
at
org.eclipse.birt.report.engine.api.impl.ReportEngine.setupSc riptScope
(ReportEngine.java:122)

at
org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEng
ine.java:89)

at
org.eclipse.birt.report.engine.api.impl.ReportEngineFactory. createRep
ortEngine(ReportEngineFactory.java:13)

at
org.eclipse.birt.report.engine.api.ReportEngine.<init>(ReportEngine.j
ava:55)

at BIRT.main(BIRT.java:70)

May 3, 2007 3:48:26 PM
org.eclipse.birt.report.engine.api.impl.ReportEngine open
ReportDesign
....... ( a lot more lines in between ) ........

FINE: ReportEngine.openReportDesign:
designName=/home/rci/BIRT2/workspace/netrec
/netrecloc.rptdesign

May 3, 2007 3:48:26 PM
org.eclipse.birt.report.model.metadata.ChoicePropertyType
validateXml

FINE: return internal name for choice Fixed

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.model.metadata.DimensionPropertyT
ype validateXml

FINE: return dimension value with user defined unit 0.075in

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.model.metadata.ChoicePropertyType
validateXml

FINE: return internal name for choice Fixed

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.model.metadata.DimensionPropertyT
ype validateXml

FINE: return dimension value with user defined unit 0.075in

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.model.metadata.ChoicePropertyType
validateXml

FINE: return internal name for choice Fixed

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.model.metadata.DimensionPropertyT
ype validateXml

FINE: return dimension value with user defined unit 0.075in

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.model.metadata.ChoicePropertyType
validateXml

FINE: return internal name for choice Fixed

May 3, 2007 3:48:28 PM
org.eclipse.birt.report.engine.api.impl.ReportEngine crea
teRunAndRenderTask

FINE: ReportEngine.createRunAndRenderTask:
reportRunnable=org.eclipse.birt.repor
t.engine.api.impl.ReportRunnable@1de891b
Re: eng.createRunAndRenderTask [message #237135 is a reply to message #237102] Tue, 08 May 2007 14:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

Does this just happen with the one report?
Can you create a report that just has a label and try it?

Also what version of BIRT are you using to design the reports?

Jason

Jo-Anne wrote:
> This is a portion of my log file from when I run the report.... It's
> 1926 lines so I didn't put it all on. I'm not sure what I'm doing wrong!
>
>
> May 3, 2007 3:48:26 PM
> org.eclipse.birt.report.engine.api.impl.ReportEngine setu
> pScriptScope
> INFO: Error occurs while initialze script
> scope
> org.mozilla.javascript.EvaluatorException: Cannot add a property to a
> sealed obj
> ect.
> ()
> at
> org.mozilla.javascript.DefaultErrorReporter.runtimeError(Def aultError
> Reporter.java:76)
> at
> org.mozilla.javascript.Context.reportRuntimeError(Context.ja va:591)
> at
> org.mozilla.javascript.Context.reportRuntimeError(Context.ja va:630)
> at
> org.mozilla.javascript.Context.reportRuntimeError0(Context.j ava:600)
> at
> org.mozilla.javascript.ScriptableObject.addSlot(ScriptableOb ject.java
> :1685)
> at
> org.mozilla.javascript.ScriptableObject.getSlotToSet(Scripta bleObject
> java:1647)
> at
> org.mozilla.javascript.ScriptableObject.put(ScriptableObject .java:247
> )
> at
> org.mozilla.javascript.IdScriptable.put(IdScriptable.java:11 1)
> at
> org.mozilla.javascript.ScriptableObject.defineProperty(Scrip tableObje
> ct.java:1077)
> at
> org.mozilla.javascript.IdScriptable.defineProperty(IdScripta ble.java:
> 194)
> at
> org.mozilla.javascript.ScriptableObject.defineProperty(Scrip tableObje
> ct.java:1103)
> at
> org.mozilla.javascript.IdScriptable.addIdFunctionProperty(Id Scriptabl
> e.java:451)
> at
> org.mozilla.javascript.NativeString.fillConstructorPropertie s(NativeS
> tring.java:71)
> at
> org.mozilla.javascript.IdScriptable.addAsPrototype(IdScripta ble.java:
> 424)
> at
> org.mozilla.javascript.NativeString.init(NativeString.java:5 7)
> at
> org.mozilla.javascript.Context.initStandardObjects(Context.j ava:703)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.setupSc riptScope
> (ReportEngine.java:122)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEng
> ine.java:89)
> at
> org.eclipse.birt.report.engine.api.impl.ReportEngineFactory. createRep
> ortEngine(ReportEngineFactory.java:13)
> at
> org.eclipse.birt.report.engine.api.ReportEngine.<init>(ReportEngine.j
> ava:55)
> at
> BIRT.main(BIRT.java:70) May
> 3, 2007 3:48:26 PM org.eclipse.birt.report.engine.api.impl.ReportEngine
> open
> ReportDesign ...... ( a lot more lines in between )
> ........
> FINE: ReportEngine.openReportDesign:
> designName=/home/rci/BIRT2/workspace/netrec
> /netrecloc.rptdesign
> May 3, 2007 3:48:26 PM
> org.eclipse.birt.report.model.metadata.ChoicePropertyType
> validateXml
> FINE: return internal name for choice
> Fixed May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.model.metadata.DimensionPropertyT
> ype
> validateXml
> FINE: return dimension value with user defined unit
> 0.075in May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.model.metadata.ChoicePropertyType
> validateXml
> FINE: return internal name for choice
> Fixed May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.model.metadata.DimensionPropertyT
> ype
> validateXml
> FINE: return dimension value with user defined unit
> 0.075in May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.model.metadata.ChoicePropertyType
> validateXml
> FINE: return internal name for choice
> Fixed May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.model.metadata.DimensionPropertyT
> ype
> validateXml
> FINE: return dimension value with user defined unit
> 0.075in May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.model.metadata.ChoicePropertyType
> validateXml
> FINE: return internal name for choice
> Fixed May 3, 2007 3:48:28 PM
> org.eclipse.birt.report.engine.api.impl.ReportEngine crea
> teRunAndRenderTask
> FINE: ReportEngine.createRunAndRenderTask:
> reportRunnable=org.eclipse.birt.repor
> t.engine.api.impl.ReportRunnable@1de891b
>
>
>
Re: eng.createRunAndRenderTask [message #237159 is a reply to message #237135] Tue, 08 May 2007 15:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

Yes I have just tried the one report but will take your suggestion. I'm
using Birt 2.1.1. I looked at the reference you made for the simple
execution but I get errors on the HashMap. I'm using java version 1.4.1,
does it have to be a newer version to use HashMap?
Re: eng.createRunAndRenderTask [message #237189 is a reply to message #237159] Tue, 08 May 2007 16:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

Just change the maps to the correct 1.4 syntax.

Jason

Jo-Anne wrote:
> Yes I have just tried the one report but will take your suggestion. I'm
> using Birt 2.1.1. I looked at the reference you made for the simple
> execution but I get errors on the HashMap. I'm using java version
> 1.4.1, does it have to be a newer version to use HashMap?
>
Re: eng.createRunAndRenderTask [message #237329 is a reply to message #237189] Wed, 09 May 2007 11:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

Thanks for you suggestions. I've made a simple report with just a label
in it and I still cannot get past that part in my java program to
RunAndRender. I've been searching the web trying to find something.
There is another person who appear to have this issue and your comment was
to use the supplied birt.war file. How is the war file used? Right now
it's sitting in my birt-runtime-2_1_1 directory. Is there something I'm
supposed to be doing with it? I put it in the classpath as I wasn't sure
if I needed it or not.
Re: eng.createRunAndRenderTask [message #237340 is a reply to message #237329] Wed, 09 May 2007 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

Here is an example that works in my 2.1.1 install. Verify that the
2.1.1 libs are in your buildpath.

Jason


import java.util.ArrayList;
import java.util.HashMap;
import java.util.logging.Level;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLActionHandler;
import org.eclipse.birt.report.engine.api.HTMLEmitterConfig;
import org.eclipse.birt.report.engine.api.HTMLRenderContext;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;

public class ExecuteReport {
public void runReport() throws EngineException
{
HashMap parameters = new HashMap();
String name = "Top Count";
Integer pvalue = new Integer(4);
parameters.put(name, pvalue);
IReportEngine engine=null;
EngineConfig config = null;
//config.setRourcePath()
try{


//Configure the Engine and start the Platform
config = new EngineConfig( );
config.setEngineHome(
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine" );
config.setLogConfig(null, Level.FINE);
config.setResourcePath("c:/mybirtresources/");
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
engine.changeLogLevel( Level.WARNING );
}catch( Exception ex){
ex.printStackTrace();
}
//Configure the emitter to handle actions and images
HTMLEmitterConfig emitterConfig = new HTMLEmitterConfig( );
emitterConfig.setActionHandler( new HTMLActionHandler( ) );
HTMLServerImageHandler imageHandler = new HTMLServerImageHandler( );
emitterConfig.setImageHandler( imageHandler );
config.getEmitterConfigs( ).put( "html", emitterConfig ); //$NON-NLS-1$
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("C:/temp/ProdLineChart.rptdesign");


//Create task to run and render the report,
IRunAndRenderTask task = engine.createRunAndRenderTask(design);

//Set Render context to handle url and image locataions
HTMLRenderContext renderContext = new HTMLRenderContext();
//Set the Base URL for all actions
renderContext.setBaseURL("http://localhost/");
//Tell the Engine to prepend all images with this URL - Note this
requires using the HTMLServerImageHandler
//renderContext.setBaseImageURL("http://localhost/myimages");
renderContext.setBaseImageURL("file:///c:/temp/");
//Tell the Engine where to write the images to
renderContext.setImageDirectory("C:/temp/");
//Tell the Engine what image formats are supported. Note you must
have SVG in the string
//to render charts in SVG.
renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
HashMap contextMap = new HashMap();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
renderContext );

task.setAppContext( contextMap );
//Set parameters for the report
task.setParameterValues(parameters);
//Alternatively set each seperately
//task.setParameterValue("Top Count", new Integer(12));
task.validateParameters();

HTMLRenderOption options = new HTMLRenderOption();
//Remove HTML and Body tags
//options.setEmbeddable(true);
//Set ouptut location
options.setOutputFileName("C:/temp/output.html");

//options.setOutputStream(response.getOutputStream());
//Set output format
options.setOutputFormat("html");
task.setRenderOption(options);
//run the report and destroy the engine
//Note - If the program stays resident do not shutdown the Platform
or the Engine
task.run();
task.close();
engine.shutdown();
Platform.shutdown();
System.out.println("Finished");
}

/**
* @param args
*/
public static void main(String[] args) {
try
{

ExecuteReport ex = new ExecuteReport( );
ex.runReport();

}
catch ( Exception e )
{
e.printStackTrace();
}
}
}


Jo-Anne wrote:
> Thanks for you suggestions. I've made a simple report with just a label
> in it and I still cannot get past that part in my java program to
> RunAndRender. I've been searching the web trying to find something.
> There is another person who appear to have this issue and your comment
> was to use the supplied birt.war file. How is the war file used? Right
> now it's sitting in my birt-runtime-2_1_1 directory. Is there something
> I'm supposed to be doing with it? I put it in the classpath as I wasn't
> sure if I needed it or not.
>
>
>
Re: eng.createRunAndRenderTask [message #237548 is a reply to message #237340] Thu, 10 May 2007 11:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

Thanks for that program Jason, I still get stopped at the same spot. I've
been trying to find something on the net regarding the following error
that I get

Exception in thread "main" java.lang.NoSuchMethodError:
org.mozilla.javascript.ImporterTopLevel.initStandardObjects( Lorg/mozilla/javascript/Context;Z)V
at
org.eclipse.birt.core.script.ScriptContext.<init>(ScriptContext.java:81)
......

What I've been finding keeps referring to the js.jar files in the
classpath. I have the following js.jar files on the system

/tomcat5/webapps/birt-viewer/WEB-INF/lib/js.jar
/tomcat5/webapps/birt-viewer/WEB-INF/platform/plugins/org.mo zilla.rhino/lib/js.jar
/eclipse/plugins/org.mozilla.rhino_1.6.0.v20060629-0630/lib/ js.jar
/birt-runtime-2_1_1/ReportEngine/lib/js.jar
/birt-runtime-2_1_1/ReportEngine/plugins/org.mozilla.rhino/l ib/js.jar
/birt-runtime-2_1_1/WebViewerExample/WEB-INF/lib/js.jar
/birt-runtime-2_1_1/WebViewerExample/WEB-INF/platform/plugin s/org.mozilla.rhino/lib/js.jar
/birt-runtime-2_1_1/ChartEngine/js.jar

Should all these js.jar files be included in the classpath? Does the
order they are in make a difference?
Re: eng.createRunAndRenderTask [message #237588 is a reply to message #237548] Thu, 10 May 2007 11:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

All the libs in the ReportEngine/lib should be in your classpath.

Jason

Jo-Anne wrote:
> Thanks for that program Jason, I still get stopped at the same spot.
> I've been trying to find something on the net regarding the following
> error that I get
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> org.mozilla.javascript.ImporterTopLevel.initStandardObjects( Lorg/mozilla/javascript/Context;Z)V
>
> at
> org.eclipse.birt.core.script.ScriptContext.<init>(ScriptContext.java:81)
> .....
>
> What I've been finding keeps referring to the js.jar files in the
> classpath. I have the following js.jar files on the system
>
> /tomcat5/webapps/birt-viewer/WEB-INF/lib/js.jar
> /tomcat5/webapps/birt-viewer/WEB-INF/platform/plugins/org.mo zilla.rhino/lib/js.jar
>
> /eclipse/plugins/org.mozilla.rhino_1.6.0.v20060629-0630/lib/ js.jar
> /birt-runtime-2_1_1/ReportEngine/lib/js.jar
> /birt-runtime-2_1_1/ReportEngine/plugins/org.mozilla.rhino/l ib/js.jar
> /birt-runtime-2_1_1/WebViewerExample/WEB-INF/lib/js.jar
> /birt-runtime-2_1_1/WebViewerExample/WEB-INF/platform/plugin s/org.mozilla.rhino/lib/js.jar
>
> /birt-runtime-2_1_1/ChartEngine/js.jar
>
> Should all these js.jar files be included in the classpath? Does the
> order they are in make a difference?
>
Re: eng.createRunAndRenderTask [message #237619 is a reply to message #237588] Thu, 10 May 2007 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

Just double checked and they are... I'm really stumped by this!
Re: eng.createRunAndRenderTask [message #237627 is a reply to message #237619] Thu, 10 May 2007 14:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

How are you building the example?
Are you using the BIRT Allinone 2.1.1 download, starting a new java
project, adding the ReportEngine/libs to the buildpath and then creating
your java class?

Jason

Jo-Anne wrote:
> Just double checked and they are... I'm really stumped by this!
>
Re: eng.createRunAndRenderTask [message #237648 is a reply to message #237627] Thu, 10 May 2007 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joannem.smartmech.com

I'm very new to this, and not so familiar with java, so I'll try to
explain what I've done.

The BIRT Allinone 2.1.1 download was used for installation. I am using a
linux system, if that makes a difference. I created a report template in
BIRT. I added the files from ReportEngine/lib to my classpath. I have
created a java program, then used the one you sent me to try and generate
this report.... but can't get past the RunAndRenderTask. This java
program is called from a background process created with php.

This is the class path that I'm using.

CLASSPATH=/usr/java142/lib/tools.jar:.:/opt/StyleReportEE/bi n/lax.jar:/opt/Style
ReportEE/lib/design_pro.jar:/opt/StyleReportEE/lib/etools.ja r:/opt/StyleReportEE
/lib/sree_pro.jar:/var/www/html/smech:/home/rci/BIRT2/eclips e/plugins/com.lowagi
e.itext_1.3.0.v20060909-0630/lib/itext-1.3.jar:/home/rci/BIR T2/birt-runtime-2_1_
1/ReportEngine:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngi ne/lib/chartengineap
i.jar:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/co m.ibm.icu_3.4.4.1.ja
r:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/common s-cli-1.0.jar:/home/
rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/commons-codec- 1.3.jar:/home/rci/BI
RT2/birt-runtime-2_1_1/ReportEngine/lib/coreapi.jar:/home/rc i/BIRT2/birt-runtime
-2_1_1/ReportEngine/lib/dataadapterapi.jar:/home/rci/BIRT2/b irt-runtime-2_1_1/Re
portEngine/lib/dteapi.jar:/home/rci/BIRT2/birt-runtime-2_1_1 /ReportEngine/lib/en
gineapi.jar:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/ lib/flute.jar:/home/
rci/BIRT2/birt-rutnime-2_1_1/ReportEngine/lib/js.jar:/home/r ci/BIRT2/birt-runtim
e-2_1_1/ReportEngine/lib/modelapi.jar:/home/rci/BIRT2/birt-r untime-2_1_1/ReportE
ngine/lib/org.eclipse.emf.common_2.2.0.v200606051102.jar:/ho me/rci/BIRT2/birt-ru
ntime-2_1_1/ReportEngine/lib/org.eclipse.emf.ecore_2.2.0.v20 0606051102.jar:/home
/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/org.eclipse.e mf.ecore.xmi_2.2.0.v
200606051102.jar:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEn gine/lib/sac.jar:/ho
me/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/scriptapi.j ar:/home/rci/BIRT2/e
clipse/plugins:/opt/sybase/SYBSsa9/java/jodbc.jar:
Re: eng.createRunAndRenderTask [message #237666 is a reply to message #237648] Thu, 10 May 2007 15:21 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jo-Anne,

That looks proper. Can you try using the Allinone Linux distro to
create a Java Project? If you can get it working in the designer this
may lead to what the issue is in deployment. First create a new project
in the allione and specify it as a java project. Right click on the new
project and modify the build path. Choose libs and add all the libs
under the ReportEngine/lib folder. Next right click on the new Java
Class and enter the code I sent you. Make sure you modify the paths to
yours. After it compiles, right click on the class and choose debug as
Java application. This should bring up the launch configuration. Select
ok and the output should show in the console view.

Alternatively you could use the genReport.bat file and run it. Open the
bat file and modify the classpath and set BIRT_HOME. Verify that the
program runs fine.

Jason

Jo-Anne wrote:
> I'm very new to this, and not so familiar with java, so I'll try to
> explain what I've done.
>
> The BIRT Allinone 2.1.1 download was used for installation. I am using
> a linux system, if that makes a difference. I created a report template
> in BIRT. I added the files from ReportEngine/lib to my classpath. I
> have created a java program, then used the one you sent me to try and
> generate this report.... but can't get past the RunAndRenderTask. This
> java program is called from a background process created with php.
> This is the class path that I'm using.
>
> CLASSPATH=/usr/java142/lib/tools.jar:.:/opt/StyleReportEE/bi n/lax.jar:/opt/Style
>
> ReportEE/lib/design_pro.jar:/opt/StyleReportEE/lib/etools.ja r:/opt/StyleReportEE
>
> /lib/sree_pro.jar:/var/www/html/smech:/home/rci/BIRT2/eclips e/plugins/com.lowagi
>
> e.itext_1.3.0.v20060909-0630/lib/itext-1.3.jar:/home/rci/BIR T2/birt-runtime-2_1_
>
> 1/ReportEngine:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngi ne/lib/chartengineap
>
> i.jar:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/co m.ibm.icu_3.4.4.1.ja
>
> r:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/common s-cli-1.0.jar:/home/
>
> rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/commons-codec- 1.3.jar:/home/rci/BI
>
> RT2/birt-runtime-2_1_1/ReportEngine/lib/coreapi.jar:/home/rc i/BIRT2/birt-runtime
>
> -2_1_1/ReportEngine/lib/dataadapterapi.jar:/home/rci/BIRT2/b irt-runtime-2_1_1/Re
>
> portEngine/lib/dteapi.jar:/home/rci/BIRT2/birt-runtime-2_1_1 /ReportEngine/lib/en
>
> gineapi.jar:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/ lib/flute.jar:/home/
>
> rci/BIRT2/birt-rutnime-2_1_1/ReportEngine/lib/js.jar:/home/r ci/BIRT2/birt-runtim
>
> e-2_1_1/ReportEngine/lib/modelapi.jar:/home/rci/BIRT2/birt-r untime-2_1_1/ReportE
>
> ngine/lib/org.eclipse.emf.common_2.2.0.v200606051102.jar:/ho me/rci/BIRT2/birt-ru
>
> ntime-2_1_1/ReportEngine/lib/org.eclipse.emf.ecore_2.2.0.v20 0606051102.jar:/home
>
> /rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/org.eclipse.e mf.ecore.xmi_2.2.0.v
>
> 200606051102.jar:/home/rci/BIRT2/birt-runtime-2_1_1/ReportEn gine/lib/sac.jar:/ho
>
> me/rci/BIRT2/birt-runtime-2_1_1/ReportEngine/lib/scriptapi.j ar:/home/rci/BIRT2/e
>
> clipse/plugins:/opt/sybase/SYBSsa9/java/jodbc.jar:
>
>
>
Previous Topic:Nightly Builds
Next Topic:Parameters (command line)
Goto Forum:
  


Current Time: Tue Jun 03 05:12:07 EDT 2025

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

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

Back to the top