我们以前使用下面的代码来设置BIRT引擎以在我们的servlet中使用,迁移指南中说您只需将BIRT jar添加到classpath中,BIRT jar就是添加到WEB-INF \ lib。从BIRT 2.5.2升级到3.7.1
当我们现在运行应用程序时,IReportEngineFactory
返回null。任何帮助表示赞赏。
public static synchronized IReportEngine getBirtEngine(ServletContext sc) throws Exception {
EngineConfig config = new EngineConfig();
config.setBIRTHome("");
config.setLogConfig("C:/Temp", Level.FINEST);
config.setLogFile("birtLog.log");
realPath = sc.getRealPath("/reports");
log.info("Server Info: " + sc.getServerInfo());
log.info(" Servlet Context Name: " + sc.getServletContextName());
log.info("Real Path: " + realPath);
log.info("#####Creating new Birt Engine#####");
//log.info("Birt Home is: " + config.getBIRTHome());
IPlatformContext context = new PlatformServletContext(sc);
config.setPlatformContext(context);
try {
Platform.startup(config);
//log.info("Birt Home is: " + config.getPlatformContext().toString());
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject
(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine(config);
}
catch (Exception e) {
throw e;
}
return birtEngine;
}
我面对完全相同的问题。 从BIRT 2.5.2升级到BIRT 3.7.1时。你解决了这个问题吗? Thanx提前,Nele – Nele 2012-01-31 10:41:44