AssertionErrorとBIRT実行時のエンジンAPI
質問
今回が初めてBIRTという報告書のエンジンで走っています。私は、コードエディタツールバー上のスニペットを提供 http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php
しかし不思議な例外:
java.lang.AssertionError でorg.eclipse.birt.ます。枠組み台。スタートアップ(ます。java:86)
ものログファイルです。
そ逃したものの構成?もし誰かがいに関するヒントお試しできます。
こちらのコードを使用してい:
public static void executeReport()
{
IReportEngine engine=null;
EngineConfig config = null;
try{
config = new EngineConfig( );
config.setBIRTHome("D:\\birt-runtime-2_3_0\\ReportEngine");
config.setLogConfig("d:/temp", Level.FINEST);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("D:\\birt-runtime-2_3_0\\ReportEngine\\samples\\hello_world.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("output/resample/Parmdisp.html");
options.setOutputFormat("html");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
}
finally
{
Platform.shutdown( );
}
}
解決
だと考え、そして、もうひとつの場合ご使用の前にスラッシュを設定する場合、loggerが問題なのか。の代わりに
config.setLogConfig("d:/temp", Level.FINEST);
のものを使用できる
config.setLogConfig("/temp", Level.FINEST);
または
config.setLogConfig("d:\\temp", Level.FINEST);
最後に、ここはサンプルコードがまずいの分割プラットフォーム、コードから自走を描画するのです。のプラットフォームには多額の費用がかかりきった。
私はカップルのEclipseプロジェクトの設定Subversionのサーバを利用報告書のエンジンのAPI(REAPIのデザインエンジンのAPI(DEAPI)することもあるとして有用なコードが複雑化してきております。
を例に必要なものSubclipseまたは破壊的なプラグインとしますに接続する必要があり、以下のリポジトリ:
http://longlake.minnovent.com/repos/birt_example
ある事業の必要なもの:
birt_api_example
birt_runtime_lib
script.lib
きを調整する必要がある一部のファイルの場所にBirtUtilラックスだと思いるファイルの場所を相対パスです。あまりに関する情報の使用方法の事例プロジェクトを自分のブログでhttp:/birtworld.blogspot.com.特に本稿では: 試験およびデバッグの報告
他のヒント
また、同じ間違いのカップル。いないか実際でも自分のコードは、以下に示すようになります:
IDesignEngine engine = null;
DesignConfig dConfig = new DesignConfig();
EngineConfig config = new EngineConfig();
IDesignEngineFactory factory = null;
config.setLogConfig(LOG_DIRECTORY, Level.FINE);
HttpServletRequest servletRequest = (HttpServletRequest) FacesContext.getCurrentInstance()
.getExternalContext().getRequest();
String u = servletRequest.getSession().getServletContext().getRealPath("/");
File f = new File(u + PATH_TO_ENGINE_HOME);
log.debug("setting engine home to:"+f.getAbsolutePath());
config.setEngineHome(f.getAbsolutePath());
Platform.startup(config);
factory = (IDesignEngineFactory) Platform.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);
engine = factory.createDesignEngine(dConfig);
SessionHandle session = engine.newSessionHandle(null);
this.design = session.openDesign(u + PATH_TO_MAIN_DESIGN);
うまく解決できる問題との比較このコードスニペットとご自身のコードです。ちなみに私のPATH_TO_ENGINE_HOMEは"/WEB-INF/プラットフォーム".[編集]を使用した完全なプラットフォーム"フォルダからのWebViewerExampleのbirt-runtime-2_1_1.atm birt-runtime-2_3_0が見込んでいます。[編集]
でいない場合は助けてくださいユーザビリティへの考慮と詳しく(例えば、コードの抜粋).