Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
IReportEngineFactory is Null
Mylsamy
When i deploy and debug my code, the IReportEngineFactory value is showed as Null. but i added the jar files for the birt engine and report engine to my project.
Here my code :
EngineConfig config = null;
config=new EngineConfig();
if (birtEngine == null)
{
if( configProps != null){
String logLevel = configProps.getProperty("logLevel");
Level level = Level.FINEST;
config.setEngineHome("G:Birtbirt-runtime-2_3_2ReportEngine");
config.setLogConfig(configProps.getProperty("G:glassfish-v2ur2domainsdomain1logsserver.log"), level);
}
//config.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, BirtEngine.class.getClassLoader());
//IPlatformContext context = new PlatformServletContext( sc );
//config.setPlatformContext( context );
//Create the report engine
//birtEngine = new ReportEngine( config );
//ReportEngine engine = new ReportEngine( null );
try
{
Platform.startup( config );
}
catch ( BirtException e )
{
e.printStackTrace( );
}
try {
//IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngineFactory factory=null;
factory=(IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
birtEngine = factory.createReportEngine( config );
}
catch(Exception e) {
}
}
Thanks in Advance
Myl
Find more posts tagged with
Comments
mwilliams
Hi Myl,
So, you did add all the jars from your reportengine/lib to your classpath?
Mylsamy
Yes, I added all reportengine/lib jar files to my project, now IReportEngineFactory is null problem was overcome,
And now the problem is started in createReportEngine( config ) using IReportEngineFactory. When i run or debug the servlet, the exception DefaultProcessorTask.doProcess(InputStream,OutputStream) comes and it throws javax.servlet.ServletException: PWC1244: Servlet execution threw an exception and the root case java.lang.NoSuchMethodError: org.eclipse.birt.report.engine.api.EngineConfig.getAppContext()Ljava/util/HashMap it displays.
Should I added any jar files to my project to recover this.
the getAppContext() method is dislabed in EngineConfig interfaces, i initialize the engineconfig and use, but the method is disabled.
How to i recover this getAppContext() error also.
Thanks in Advance
Myl
Mylsamy
Thank you mwilliams ,
I figured out of that problem.
Am using this link to overcome my problem .,
It is very useful to integrate a report in birt report using servlet.
mwilliams
Myl,
It doesn't look like the link showed up that you posted.