BIRT的demo运行时报错,各位没事路过看看吧
信息: Error occurs while start the platform
org.eclipse.birt.core.exception.BirtException: $NO-RB$ Can't startup the OSGI framework at org.eclipse.birt.core.framework.Platform.startup(Platform.java:90)
at org.eclipse.birt.report.model.api.DesignEngine.<init>(DesignEngine.java:71)
at org.eclipse.birt.report.model.api.DesignEngine.newSession(DesignEngine.java:128)
at newDemo.buildReport(newDemo.java:37)
at newDemo.main(newDemo.java:24)
Caused by: org.eclipse.birt.core.exception.BirtException: $NO-RB$ Could not find the Framework - {0}
at org.eclipse.birt.core.framework.osgi.OSGILauncher.startup(OSGILauncher.java:88)
at org.eclipse.birt.core.framework.Platform.startup(Platform.java:78)
... 4 more
2006-9-5 16:39:03 org.eclipse.birt.report.model.api.DesignEngine <init>
信息: Can not start the design engine.
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.birt.report.model.api.DesignEngine.newSessionHandle(DesignEngine.java:106)
at org.eclipse.birt.report.model.api.DesignEngine.newSession(DesignEngine.java:128)
at newDemo.buildReport(newDemo.java:37)
at newDemo.main(newDemo.java:24)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can't startup the OSGI framework 貌似主要是这个问题,谁知道么
程序应该没问题吧,是从官网上下的Demo
import java.io.IOException;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.DesignEngine;
import org.eclipse.birt.report.model.api.ElementFactory;
import org.eclipse.birt.report.model.api.GridHandle;
import org.eclipse.birt.report.model.api.ImageHandle;
import org.eclipse.birt.report.model.api.LabelHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.RowHandle;
import org.eclipse.birt.report.model.api.SessionHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
public class newDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
buildReport();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SemanticException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
static void buildReport() throws IOException, SemanticException {
// Create a session handle. This is used to manage all open designs.
// Your app need create the session only once.
SessionHandle session = DesignEngine.newSession(null);
// Create a new report design.
ReportDesignHandle design = session.createDesign();
// The element factory creates instances of the various BIRT elements.
ElementFactory factory = design.getElementFactory();
// Create a simple master page that describes how the report will
// appear when printed.
//
// Note: The report will fail to load in the BIRT designer
// unless you create a master page.
DesignElementHandle element = factory
.newSimpleMasterPage("Page Master"); //$NON-NLS-1$
design.getMasterPages().add(element);
// Create a grid and add it to the "body" slot of the report
// design.
GridHandle grid = factory
.newGridItem(null, 2 /* cols */, 1 /* row */);
design.getBody().add(grid);
// Note: Set the table width to 100% to prevent the label
// from appearing too narrow in the layout view.
grid.setWidth("100%"); //$NON-NLS-1$
// Get the first row.
RowHandle row = (RowHandle) grid.getRows().get(0);
// Create an image and add it to the first cell.
ImageHandle image = factory.newImage(null);
CellHandle cell = (CellHandle) row.getCells().get(0);
cell.getContent().add(image);
image.setURI("http://www.eclipse.org/birt/tutorial/multichip-4.jpg"); //$NON-NLS-1$
// Create a label and add it to the second cell.
LabelHandle label = factory.newLabel(null);
cell = (CellHandle) row.getCells().get(1);
cell.getContent().add(label);
label.setText("Hello, world!"); //$NON-NLS-1$
// Save the design and close it.
design.saveAs("sample.rptdesign"); //$NON-NLS-1$
design.close();
// We're done!
}
}
大家给我点希望吧~~~~~~~~~~~~~~~~~~

