Skip to main content



      Home
Home » Archived » BIRT » Having birt.war & other application running on same application server
Having birt.war & other application running on same application server [message #365010] Fri, 05 September 2008 06:24 Go to next message
Eclipse UserFriend
Originally posted by: moi.toto.com

Hello,

When using Birt-viewer and another war application which use BIRT API,
I've got this error based on those steps :
.. Access application which is using birt API
.. Access to birt viewer

Error :
<<
12:10:15,654 INFO [STDOUT] at
org.eclipse.birt.report.model.api.DesignEngin
e.newSessionHandle(DesignEngine.java:108)
12:10:15,656 INFO [STDOUT] at
org.eclipse.birt.report.engine.parser.ReportP
arser.getDesignHandle(ReportParser.java:143)
12:10:15,657 INFO [STDOUT] at
org.eclipse.birt.report.engine.api.impl.Repor
tEngineHelper.openReportDesign(ReportEngineHelper.java:251)
12:10:15,661 INFO [STDOUT] at
org.eclipse.birt.report.engine.api.impl.Repor
tEngine.openReportDesign(ReportEngine.java:550)
12:10:15,665 INFO [STDOUT] at
org.eclipse.birt.report.service.ReportEngineS
ervice.openReportDesign(ReportEngineService.java:366)
12:10:15,668 INFO [STDOUT] at
org.eclipse.birt.report.utility.BirtUtility.g
etRunnableFromDesignFile(BirtUtility.java:590)
12:10:15,671 INFO [STDOUT] at
org.eclipse.birt.report.context.ViewerAttribu
teBean.getDesignHandle(ViewerAttributeBean.java:641)
12:10:15,673 INFO [STDOUT] at
org.eclipse.birt.report.context.ViewerAttribu
teBean.__init(ViewerAttributeBean.java:227)
12:10:15,676 INFO [STDOUT] at
org.eclipse.birt.report.context.BaseAttribute
Bean.init(BaseAttributeBean.java:243)
12:10:15,679 INFO [STDOUT] at
org.eclipse.birt.report.context.ViewerAttribu
teBean.<init>(ViewerAttributeBean.java:112)
12:10:15,681 INFO [STDOUT] at
org.eclipse.birt.report.context.BirtContext._
_init(BirtContext.java:44)
12:10:15,683 INFO [STDOUT] at
org.eclipse.birt.report.context.BaseContext.<
init>(BaseContext.java:69)
12:10:15,686 INFO [STDOUT] at
org.eclipse.birt.report.context.BirtContext.<
init>(BirtContext.java:30)
12:10:15,687 INFO [STDOUT] at
org.eclipse.birt.report.servlet.ViewerServlet
..__getContext(ViewerServlet.java:150)
12:10:15,689 INFO [STDOUT] at
org.eclipse.birt.report.servlet.BirtSoapMessa
geDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.j ava:137)
12:10:15,691 INFO [STDOUT] at
javax.servlet.http.HttpServlet.service(HttpSe
rvlet.java:697)
12:10:15,693 INFO [STDOUT] at
org.apache.axis.transport.http.AxisServletBas
e.service(AxisServletBase.java:327)
12:10:15,696 INFO [STDOUT] at
javax.servlet.http.HttpServlet.service(HttpSe
rvlet.java:810)
12:10:15,697 INFO [STDOUT] at
org.eclipse.birt.report.servlet.BirtSoapMessa
geDispatcherServlet.service(BirtSoapMessageDispatcherServlet .java:112)
12:10:15,698 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:237)
12:10:15,702 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:157)
12:10:15,703 INFO [STDOUT] at
org.eclipse.birt.report.filter.ViewerFilter.d
oFilter(ViewerFilter.java:68)
12:10:15,704 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:186)
12:10:15,707 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:157)
12:10:15,709 INFO [STDOUT] at
org.jboss.web.tomcat.filters.ReplyHeaderFilte
r.doFilter(ReplyHeaderFilter.java:75)
12:10:15,712 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:186)
12:10:15,714 INFO [STDOUT] at
org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:157)
12:10:15,718 INFO [STDOUT] at
org.apache.catalina.core.StandardWrapperValve
..invoke(StandardWrapperValve.java:214)
12:10:15,720 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:104)
12:10:15,721 INFO [STDOUT] at
org.apache.catalina.core.StandardPipeline.inv
oke(StandardPipeline.java:520)
12:10:15,725 INFO [STDOUT] at
org.apache.catalina.core.StandardContextValve
..invokeInternal(StandardContextValve.java:198)
12:10:15,727 INFO [STDOUT] at
org.apache.catalina.core.StandardContextValve
..invoke(StandardContextValve.java:152)
12:10:15,728 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:104)
12:10:15,729 INFO [STDOUT] at
org.jboss.web.tomcat.security.CustomPrincipal
Valve.invoke(CustomPrincipalValve.java:44)
12:10:15,730 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:102)
12:10:15,731 INFO [STDOUT] at
org.jboss.web.tomcat.security.SecurityAssocia
tionValve.invoke(SecurityAssociationValve.java:169)
12:10:15,734 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:102)
12:10:15,735 INFO [STDOUT] at
org.apache.catalina.core.StandardPipeline.inv
oke(StandardPipeline.java:520)
12:10:15,736 INFO [STDOUT] at
org.apache.catalina.core.StandardHostValve.in
voke(StandardHostValve.java:137)
12:10:15,738 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:104)
12:10:15,740 INFO [STDOUT] at
org.apache.catalina.valves.ErrorReportValve.i
nvoke(ErrorReportValve.java:118)
12:10:15,741 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:102)
12:10:15,743 INFO [STDOUT] at
org.jboss.web.tomcat.tc5.jca.CachedConnection
Valve.invoke(CachedConnectionValve.java:139)
12:10:15,745 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:102)
12:10:15,748 INFO [STDOUT] at
org.apache.catalina.core.StandardPipeline.inv
oke(StandardPipeline.java:520)
12:10:15,749 INFO [STDOUT] at
org.apache.catalina.core.StandardEngineValve.
invoke(StandardEngineValve.java:109)
12:10:15,751 INFO [STDOUT] at
org.apache.catalina.core.StandardValveContext
..invokeNext(StandardValveContext.java:104)
12:10:15,754 INFO [STDOUT] at
org.apache.catalina.core.StandardPipeline.inv
oke(StandardPipeline.java:520)
12:10:15,756 INFO [STDOUT] at
org.apache.catalina.core.ContainerBase.invoke
(ContainerBase.java:929)
12:10:15,757 INFO [STDOUT] at
org.apache.coyote.tomcat5.CoyoteAdapter.servi
ce(CoyoteAdapter.java:160)
12:10:15,760 INFO [STDOUT] at
org.apache.coyote.http11.Http11Processor.proc
ess(Http11Processor.java:799)
12:10:15,761 INFO [STDOUT] at
org.apache.coyote.http11.Http11Protocol$Http1
1ConnectionHandler.processConnection(Http11Protocol.java:705 )
12:10:15,763 INFO [STDOUT] at
org.apache.tomcat.util.net.TcpWorkerThread.ru
nIt(PoolTcpEndpoint.java:577)
12:10:15,766 INFO [STDOUT] at
org.apache.tomcat.util.threads.ThreadPool$Con
trolRunnable.run(ThreadPool.java:683)
12:10:15,767 INFO [STDOUT] at java.lang.Thread.run(Thread.java:619)
>>

war application code :
<<
String reportName = req.getParameter("report_name");

EngineConfig engConfig = new EngineConfig();
engConfig.setEngineHome("");

IPlatformContext context = new PlatformServletContext(
getServletContext() );

Platform.startup(engConfig);

IReportEngineFactory factory = (IReportEngineFactory)
Platform.createFactoryObject(
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( engConfig );
engine.changeLogLevel( Level.WARNING );

IReportRunnable report = engine.openReportDesign("c:/" +
reportName);

//Create task to run and render the report,
IRunAndRenderTask task = engine.createRunAndRenderTask(report);
//Set parent classloader for engine

task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY,
this.getClass().getClassLoader());

//Setup rendering to HTML/Excel

HTMLRenderOption options = new HTMLRenderOption();
options.setOutputStream(resp.getOutputStream());
options.setOutputFormat("html");
resp.setContentType("dummyNameForSaveDialogOpening/Test");
options.setImageDirectory(c:/images);
options.setBaseImageURL("http://localhost/images");
options.setImageHandler(new HTMLServerImageHandler());
options.setEmbeddable(false);
task.setRenderOption(options);
task.run();
task.close();

engine.destroy();
Platform.shutdown();
>>

If I remove the Platform.shutdown() it works but there are some memory
leaks.

So do you have a solution to have a WAR application which is using Birt
API and birt viewer on the same application server (jboss or tomcat) ?


Regards,
Blured.
Re: Having birt.war & other application running on same application server [message #365027 is a reply to message #365010] Fri, 05 September 2008 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Moi,

I have not tried this, but you may be able to point the API BIRT_HOME to
the location of the Platform directory for the webviewer and do not use
a PlatformServletContext. BTW Platform start up and shutdown should
only happen once for your app. It is very inefficient to start and stop
for every request. Also only destroy the engine on shutdown of the app.
Can you give some more detail on the memory leak?

Jason

moi wrote:
> Hello,
>
> When using Birt-viewer and another war application which use BIRT API,
> I've got this error based on those steps :
> . Access application which is using birt API
> . Access to birt viewer
>
> Error :
> <<
> 12:10:15,654 INFO [STDOUT] at
> org.eclipse.birt.report.model.api.DesignEngin
> e.newSessionHandle(DesignEngine.java:108)
> 12:10:15,656 INFO [STDOUT] at
> org.eclipse.birt.report.engine.parser.ReportP
> arser.getDesignHandle(ReportParser.java:143)
> 12:10:15,657 INFO [STDOUT] at
> org.eclipse.birt.report.engine.api.impl.Repor
> tEngineHelper.openReportDesign(ReportEngineHelper.java:251)
> 12:10:15,661 INFO [STDOUT] at
> org.eclipse.birt.report.engine.api.impl.Repor
> tEngine.openReportDesign(ReportEngine.java:550)
> 12:10:15,665 INFO [STDOUT] at
> org.eclipse.birt.report.service.ReportEngineS
> ervice.openReportDesign(ReportEngineService.java:366)
> 12:10:15,668 INFO [STDOUT] at
> org.eclipse.birt.report.utility.BirtUtility.g
> etRunnableFromDesignFile(BirtUtility.java:590)
> 12:10:15,671 INFO [STDOUT] at
> org.eclipse.birt.report.context.ViewerAttribu
> teBean.getDesignHandle(ViewerAttributeBean.java:641)
> 12:10:15,673 INFO [STDOUT] at
> org.eclipse.birt.report.context.ViewerAttribu
> teBean.__init(ViewerAttributeBean.java:227)
> 12:10:15,676 INFO [STDOUT] at
> org.eclipse.birt.report.context.BaseAttribute
> Bean.init(BaseAttributeBean.java:243)
> 12:10:15,679 INFO [STDOUT] at
> org.eclipse.birt.report.context.ViewerAttribu
> teBean.<init>(ViewerAttributeBean.java:112)
> 12:10:15,681 INFO [STDOUT] at
> org.eclipse.birt.report.context.BirtContext._
> _init(BirtContext.java:44)
> 12:10:15,683 INFO [STDOUT] at
> org.eclipse.birt.report.context.BaseContext.<
> init>(BaseContext.java:69)
> 12:10:15,686 INFO [STDOUT] at
> org.eclipse.birt.report.context.BirtContext.<
> init>(BirtContext.java:30)
> 12:10:15,687 INFO [STDOUT] at
> org.eclipse.birt.report.servlet.ViewerServlet
> .__getContext(ViewerServlet.java:150)
> 12:10:15,689 INFO [STDOUT] at
> org.eclipse.birt.report.servlet.BirtSoapMessa
> geDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.j ava:137)
> 12:10:15,691 INFO [STDOUT] at
> javax.servlet.http.HttpServlet.service(HttpSe
> rvlet.java:697)
> 12:10:15,693 INFO [STDOUT] at
> org.apache.axis.transport.http.AxisServletBas
> e.service(AxisServletBase.java:327)
> 12:10:15,696 INFO [STDOUT] at
> javax.servlet.http.HttpServlet.service(HttpSe
> rvlet.java:810)
> 12:10:15,697 INFO [STDOUT] at
> org.eclipse.birt.report.servlet.BirtSoapMessa
> geDispatcherServlet.service(BirtSoapMessageDispatcherServlet .java:112)
> 12:10:15,698 INFO [STDOUT] at
> org.apache.catalina.core.ApplicationFilterCha
> in.internalDoFilter(ApplicationFilterChain.java:237)
> 12:10:15,702 INFO [STDOUT] at
> org.apache.catalina.core.ApplicationFilterCha
> in.doFilter(ApplicationFilterChain.java:157)
> 12:10:15,703 INFO [STDOUT] at
> org.eclipse.birt.report.filter.ViewerFilter.d
> oFilter(ViewerFilter.java:68)
> 12:10:15,704 INFO [STDOUT] at
> org.apache.catalina.core.ApplicationFilterCha
> in.internalDoFilter(ApplicationFilterChain.java:186)
> 12:10:15,707 INFO [STDOUT] at
> org.apache.catalina.core.ApplicationFilterCha
> in.doFilter(ApplicationFilterChain.java:157)
> 12:10:15,709 INFO [STDOUT] at
> org.jboss.web.tomcat.filters.ReplyHeaderFilte
> r.doFilter(ReplyHeaderFilter.java:75)
> 12:10:15,712 INFO [STDOUT] at
> org.apache.catalina.core.ApplicationFilterCha
> in.internalDoFilter(ApplicationFilterChain.java:186)
> 12:10:15,714 INFO [STDOUT] at
> org.apache.catalina.core.ApplicationFilterCha
> in.doFilter(ApplicationFilterChain.java:157)
> 12:10:15,718 INFO [STDOUT] at
> org.apache.catalina.core.StandardWrapperValve
> .invoke(StandardWrapperValve.java:214)
> 12:10:15,720 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:104)
> 12:10:15,721 INFO [STDOUT] at
> org.apache.catalina.core.StandardPipeline.inv
> oke(StandardPipeline.java:520)
> 12:10:15,725 INFO [STDOUT] at
> org.apache.catalina.core.StandardContextValve
> .invokeInternal(StandardContextValve.java:198)
> 12:10:15,727 INFO [STDOUT] at
> org.apache.catalina.core.StandardContextValve
> .invoke(StandardContextValve.java:152)
> 12:10:15,728 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:104)
> 12:10:15,729 INFO [STDOUT] at
> org.jboss.web.tomcat.security.CustomPrincipal
> Valve.invoke(CustomPrincipalValve.java:44)
> 12:10:15,730 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:102)
> 12:10:15,731 INFO [STDOUT] at
> org.jboss.web.tomcat.security.SecurityAssocia
> tionValve.invoke(SecurityAssociationValve.java:169)
> 12:10:15,734 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:102)
> 12:10:15,735 INFO [STDOUT] at
> org.apache.catalina.core.StandardPipeline.inv
> oke(StandardPipeline.java:520)
> 12:10:15,736 INFO [STDOUT] at
> org.apache.catalina.core.StandardHostValve.in
> voke(StandardHostValve.java:137)
> 12:10:15,738 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:104)
> 12:10:15,740 INFO [STDOUT] at
> org.apache.catalina.valves.ErrorReportValve.i
> nvoke(ErrorReportValve.java:118)
> 12:10:15,741 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:102)
> 12:10:15,743 INFO [STDOUT] at
> org.jboss.web.tomcat.tc5.jca.CachedConnection
> Valve.invoke(CachedConnectionValve.java:139)
> 12:10:15,745 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:102)
> 12:10:15,748 INFO [STDOUT] at
> org.apache.catalina.core.StandardPipeline.inv
> oke(StandardPipeline.java:520)
> 12:10:15,749 INFO [STDOUT] at
> org.apache.catalina.core.StandardEngineValve.
> invoke(StandardEngineValve.java:109)
> 12:10:15,751 INFO [STDOUT] at
> org.apache.catalina.core.StandardValveContext
> .invokeNext(StandardValveContext.java:104)
> 12:10:15,754 INFO [STDOUT] at
> org.apache.catalina.core.StandardPipeline.inv
> oke(StandardPipeline.java:520)
> 12:10:15,756 INFO [STDOUT] at
> org.apache.catalina.core.ContainerBase.invoke
> (ContainerBase.java:929)
> 12:10:15,757 INFO [STDOUT] at
> org.apache.coyote.tomcat5.CoyoteAdapter.servi
> ce(CoyoteAdapter.java:160)
> 12:10:15,760 INFO [STDOUT] at
> org.apache.coyote.http11.Http11Processor.proc
> ess(Http11Processor.java:799)
> 12:10:15,761 INFO [STDOUT] at
> org.apache.coyote.http11.Http11Protocol$Http1
> 1ConnectionHandler.processConnection(Http11Protocol.java:705 )
> 12:10:15,763 INFO [STDOUT] at
> org.apache.tomcat.util.net.TcpWorkerThread.ru
> nIt(PoolTcpEndpoint.java:577)
> 12:10:15,766 INFO [STDOUT] at
> org.apache.tomcat.util.threads.ThreadPool$Con
> trolRunnable.run(ThreadPool.java:683)
> 12:10:15,767 INFO [STDOUT] at java.lang.Thread.run(Thread.java:619)
> >>
>
> war application code :
> <<
> String reportName = req.getParameter("report_name");
>
> EngineConfig engConfig = new EngineConfig();
> engConfig.setEngineHome("");
>
> IPlatformContext context = new PlatformServletContext(
> getServletContext() );
>
> Platform.startup(engConfig);
>
> IReportEngineFactory factory = (IReportEngineFactory)
> Platform.createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> IReportEngine engine = factory.createReportEngine( engConfig );
> engine.changeLogLevel( Level.WARNING );
>
> IReportRunnable report = engine.openReportDesign("c:/" +
> reportName);
>
> //Create task to run and render the report,
> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
> //Set parent classloader for engine
>
> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY,
> this.getClass().getClassLoader());
>
> //Setup rendering to HTML/Excel
>
> HTMLRenderOption options = new HTMLRenderOption();
> options.setOutputStream(resp.getOutputStream());
> options.setOutputFormat("html");
> resp.setContentType("dummyNameForSaveDialogOpening/Test");
> options.setImageDirectory(c:/images);
> options.setBaseImageURL("http://localhost/images");
> options.setImageHandler(new HTMLServerImageHandler());
> options.setEmbeddable(false);
> task.setRenderOption(options);
> task.run();
> task.close();
>
> engine.destroy();
> Platform.shutdown();
> >>
>
> If I remove the Platform.shutdown() it works but there are some memory
> leaks.
>
> So do you have a solution to have a WAR application which is using Birt
> API and birt viewer on the same application server (jboss or tomcat) ?
>
>
> Regards,
> Blured.
Re: Having birt.war & other application running on same application server [message #365042 is a reply to message #365027] Mon, 08 September 2008 05:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: moi.toto.com

Hello,

I'm making more test to see if the memory leak is still there or not.

The platform start up & shutdown also occurs with web viewer each time
it is launched is'nt it ? If it is the case how can I modify it to
launch the platform only on the startup of application and close it when
the application is powered off ?

Is the Birt engine shared by all application (war) on an application
server if we use
<<
EngineConfig engConfig = new EngineConfig();
engConfig.setEngineHome("");

IPlatformContext context = new PlatformServletContext(
getServletContext() );
Platform.startup(engConfig);
>>
Or does it launch a specific engine instance ?


It seems that as soon as I call
<<
engine.destroy();
Platform.shutdown();
>> in my specific war, there is something missing for the birt-viewer.

Regards,
Blured.

Jason Weathersby a écrit :
> Moi,
>
> I have not tried this, but you may be able to point the API BIRT_HOME to
> the location of the Platform directory for the webviewer and do not use
> a PlatformServletContext. BTW Platform start up and shutdown should
> only happen once for your app. It is very inefficient to start and stop
> for every request. Also only destroy the engine on shutdown of the app.
> Can you give some more detail on the memory leak?
>
> Jason
>
> moi wrote:
>> Hello,
>>
>> When using Birt-viewer and another war application which use BIRT API,
>> I've got this error based on those steps :
>> . Access application which is using birt API
>> . Access to birt viewer
>>
>> Error :
>> <<
>> 12:10:15,654 INFO [STDOUT] at
>> org.eclipse.birt.report.model.api.DesignEngin
>> e.newSessionHandle(DesignEngine.java:108)
>> 12:10:15,656 INFO [STDOUT] at
>> org.eclipse.birt.report.engine.parser.ReportP
>> arser.getDesignHandle(ReportParser.java:143)
>> 12:10:15,657 INFO [STDOUT] at
>> org.eclipse.birt.report.engine.api.impl.Repor
>> tEngineHelper.openReportDesign(ReportEngineHelper.java:251)
>> 12:10:15,661 INFO [STDOUT] at
>> org.eclipse.birt.report.engine.api.impl.Repor
>> tEngine.openReportDesign(ReportEngine.java:550)
>> 12:10:15,665 INFO [STDOUT] at
>> org.eclipse.birt.report.service.ReportEngineS
>> ervice.openReportDesign(ReportEngineService.java:366)
>> 12:10:15,668 INFO [STDOUT] at
>> org.eclipse.birt.report.utility.BirtUtility.g
>> etRunnableFromDesignFile(BirtUtility.java:590)
>> 12:10:15,671 INFO [STDOUT] at
>> org.eclipse.birt.report.context.ViewerAttribu
>> teBean.getDesignHandle(ViewerAttributeBean.java:641)
>> 12:10:15,673 INFO [STDOUT] at
>> org.eclipse.birt.report.context.ViewerAttribu
>> teBean.__init(ViewerAttributeBean.java:227)
>> 12:10:15,676 INFO [STDOUT] at
>> org.eclipse.birt.report.context.BaseAttribute
>> Bean.init(BaseAttributeBean.java:243)
>> 12:10:15,679 INFO [STDOUT] at
>> org.eclipse.birt.report.context.ViewerAttribu
>> teBean.<init>(ViewerAttributeBean.java:112)
>> 12:10:15,681 INFO [STDOUT] at
>> org.eclipse.birt.report.context.BirtContext._
>> _init(BirtContext.java:44)
>> 12:10:15,683 INFO [STDOUT] at
>> org.eclipse.birt.report.context.BaseContext.<
>> init>(BaseContext.java:69)
>> 12:10:15,686 INFO [STDOUT] at
>> org.eclipse.birt.report.context.BirtContext.<
>> init>(BirtContext.java:30)
>> 12:10:15,687 INFO [STDOUT] at
>> org.eclipse.birt.report.servlet.ViewerServlet
>> .__getContext(ViewerServlet.java:150)
>> 12:10:15,689 INFO [STDOUT] at
>> org.eclipse.birt.report.servlet.BirtSoapMessa
>> geDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.j ava:137)
>> 12:10:15,691 INFO [STDOUT] at
>> javax.servlet.http.HttpServlet.service(HttpSe
>> rvlet.java:697)
>> 12:10:15,693 INFO [STDOUT] at
>> org.apache.axis.transport.http.AxisServletBas
>> e.service(AxisServletBase.java:327)
>> 12:10:15,696 INFO [STDOUT] at
>> javax.servlet.http.HttpServlet.service(HttpSe
>> rvlet.java:810)
>> 12:10:15,697 INFO [STDOUT] at
>> org.eclipse.birt.report.servlet.BirtSoapMessa
>> geDispatcherServlet.service(BirtSoapMessageDispatcherServlet .java:112)
>> 12:10:15,698 INFO [STDOUT] at
>> org.apache.catalina.core.ApplicationFilterCha
>> in.internalDoFilter(ApplicationFilterChain.java:237)
>> 12:10:15,702 INFO [STDOUT] at
>> org.apache.catalina.core.ApplicationFilterCha
>> in.doFilter(ApplicationFilterChain.java:157)
>> 12:10:15,703 INFO [STDOUT] at
>> org.eclipse.birt.report.filter.ViewerFilter.d
>> oFilter(ViewerFilter.java:68)
>> 12:10:15,704 INFO [STDOUT] at
>> org.apache.catalina.core.ApplicationFilterCha
>> in.internalDoFilter(ApplicationFilterChain.java:186)
>> 12:10:15,707 INFO [STDOUT] at
>> org.apache.catalina.core.ApplicationFilterCha
>> in.doFilter(ApplicationFilterChain.java:157)
>> 12:10:15,709 INFO [STDOUT] at
>> org.jboss.web.tomcat.filters.ReplyHeaderFilte
>> r.doFilter(ReplyHeaderFilter.java:75)
>> 12:10:15,712 INFO [STDOUT] at
>> org.apache.catalina.core.ApplicationFilterCha
>> in.internalDoFilter(ApplicationFilterChain.java:186)
>> 12:10:15,714 INFO [STDOUT] at
>> org.apache.catalina.core.ApplicationFilterCha
>> in.doFilter(ApplicationFilterChain.java:157)
>> 12:10:15,718 INFO [STDOUT] at
>> org.apache.catalina.core.StandardWrapperValve
>> .invoke(StandardWrapperValve.java:214)
>> 12:10:15,720 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:104)
>> 12:10:15,721 INFO [STDOUT] at
>> org.apache.catalina.core.StandardPipeline.inv
>> oke(StandardPipeline.java:520)
>> 12:10:15,725 INFO [STDOUT] at
>> org.apache.catalina.core.StandardContextValve
>> .invokeInternal(StandardContextValve.java:198)
>> 12:10:15,727 INFO [STDOUT] at
>> org.apache.catalina.core.StandardContextValve
>> .invoke(StandardContextValve.java:152)
>> 12:10:15,728 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:104)
>> 12:10:15,729 INFO [STDOUT] at
>> org.jboss.web.tomcat.security.CustomPrincipal
>> Valve.invoke(CustomPrincipalValve.java:44)
>> 12:10:15,730 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:102)
>> 12:10:15,731 INFO [STDOUT] at
>> org.jboss.web.tomcat.security.SecurityAssocia
>> tionValve.invoke(SecurityAssociationValve.java:169)
>> 12:10:15,734 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:102)
>> 12:10:15,735 INFO [STDOUT] at
>> org.apache.catalina.core.StandardPipeline.inv
>> oke(StandardPipeline.java:520)
>> 12:10:15,736 INFO [STDOUT] at
>> org.apache.catalina.core.StandardHostValve.in
>> voke(StandardHostValve.java:137)
>> 12:10:15,738 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:104)
>> 12:10:15,740 INFO [STDOUT] at
>> org.apache.catalina.valves.ErrorReportValve.i
>> nvoke(ErrorReportValve.java:118)
>> 12:10:15,741 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:102)
>> 12:10:15,743 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.jca.CachedConnection
>> Valve.invoke(CachedConnectionValve.java:139)
>> 12:10:15,745 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:102)
>> 12:10:15,748 INFO [STDOUT] at
>> org.apache.catalina.core.StandardPipeline.inv
>> oke(StandardPipeline.java:520)
>> 12:10:15,749 INFO [STDOUT] at
>> org.apache.catalina.core.StandardEngineValve.
>> invoke(StandardEngineValve.java:109)
>> 12:10:15,751 INFO [STDOUT] at
>> org.apache.catalina.core.StandardValveContext
>> .invokeNext(StandardValveContext.java:104)
>> 12:10:15,754 INFO [STDOUT] at
>> org.apache.catalina.core.StandardPipeline.inv
>> oke(StandardPipeline.java:520)
>> 12:10:15,756 INFO [STDOUT] at
>> org.apache.catalina.core.ContainerBase.invoke
>> (ContainerBase.java:929)
>> 12:10:15,757 INFO [STDOUT] at
>> org.apache.coyote.tomcat5.CoyoteAdapter.servi
>> ce(CoyoteAdapter.java:160)
>> 12:10:15,760 INFO [STDOUT] at
>> org.apache.coyote.http11.Http11Processor.proc
>> ess(Http11Processor.java:799)
>> 12:10:15,761 INFO [STDOUT] at
>> org.apache.coyote.http11.Http11Protocol$Http1
>> 1ConnectionHandler.processConnection(Http11Protocol.java:705 )
>> 12:10:15,763 INFO [STDOUT] at
>> org.apache.tomcat.util.net.TcpWorkerThread.ru
>> nIt(PoolTcpEndpoint.java:577)
>> 12:10:15,766 INFO [STDOUT] at
>> org.apache.tomcat.util.threads.ThreadPool$Con
>> trolRunnable.run(ThreadPool.java:683)
>> 12:10:15,767 INFO [STDOUT] at java.lang.Thread.run(Thread.java:619)
>> >>
>>
>> war application code :
>> <<
>> String reportName = req.getParameter("report_name");
>>
>> EngineConfig engConfig = new EngineConfig();
>> engConfig.setEngineHome("");
>>
>> IPlatformContext context = new PlatformServletContext(
>> getServletContext() );
>>
>> Platform.startup(engConfig);
>>
>> IReportEngineFactory factory = (IReportEngineFactory)
>> Platform.createFactoryObject(
>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>> IReportEngine engine = factory.createReportEngine( engConfig );
>> engine.changeLogLevel( Level.WARNING );
>>
>> IReportRunnable report = engine.openReportDesign("c:/" +
>> reportName);
>>
>> //Create task to run and render the report,
>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>> //Set parent classloader for engine
>>
>> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY,
>> this.getClass().getClassLoader());
>>
>> //Setup rendering to HTML/Excel
>>
>> HTMLRenderOption options = new HTMLRenderOption();
>> options.setOutputStream(resp.getOutputStream());
>> options.setOutputFormat("html");
>> resp.setContentType("dummyNameForSaveDialogOpening/Test");
>> options.setImageDirectory(c:/images);
>> options.setBaseImageURL("http://localhost/images");
>> options.setImageHandler(new HTMLServerImageHandler());
>> options.setEmbeddable(false);
>> task.setRenderOption(options);
>> task.run();
>> task.close();
>>
>> engine.destroy();
>> Platform.shutdown();
>> >>
>>
>> If I remove the Platform.shutdown() it works but there are some memory
>> leaks.
>>
>> So do you have a solution to have a WAR application which is using
>> Birt API and birt viewer on the same application server (jboss or
>> tomcat) ?
>>
>>
>> Regards,
>> Blured.
Re: Having birt.war & other application running on same application server [message #365048 is a reply to message #365042] Mon, 08 September 2008 11:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Moi,

Take a look at this example:
http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1

Jason

moi wrote:
> Hello,
>
> I'm making more test to see if the memory leak is still there or not.
>
> The platform start up & shutdown also occurs with web viewer each time
> it is launched is'nt it ? If it is the case how can I modify it to
> launch the platform only on the startup of application and close it when
> the application is powered off ?
>
> Is the Birt engine shared by all application (war) on an application
> server if we use
> <<
> EngineConfig engConfig = new EngineConfig();
> engConfig.setEngineHome("");
>
> IPlatformContext context = new PlatformServletContext(
> getServletContext() );
> Platform.startup(engConfig);
> >>
> Or does it launch a specific engine instance ?
>
>
> It seems that as soon as I call
> <<
> engine.destroy();
> Platform.shutdown();
> >> in my specific war, there is something missing for the birt-viewer.
>
> Regards,
> Blured.
>
> Jason Weathersby a écrit :
>> Moi,
>>
>> I have not tried this, but you may be able to point the API BIRT_HOME
>> to the location of the Platform directory for the webviewer and do not
>> use a PlatformServletContext. BTW Platform start up and shutdown
>> should only happen once for your app. It is very inefficient to start
>> and stop for every request. Also only destroy the engine on shutdown
>> of the app. Can you give some more detail on the memory leak?
>>
>> Jason
>>
>> moi wrote:
>>> Hello,
>>>
>>> When using Birt-viewer and another war application which use BIRT
>>> API, I've got this error based on those steps :
>>> . Access application which is using birt API
>>> . Access to birt viewer
>>>
>>> Error :
>>> <<
>>> 12:10:15,654 INFO [STDOUT] at
>>> org.eclipse.birt.report.model.api.DesignEngin
>>> e.newSessionHandle(DesignEngine.java:108)
>>> 12:10:15,656 INFO [STDOUT] at
>>> org.eclipse.birt.report.engine.parser.ReportP
>>> arser.getDesignHandle(ReportParser.java:143)
>>> 12:10:15,657 INFO [STDOUT] at
>>> org.eclipse.birt.report.engine.api.impl.Repor
>>> tEngineHelper.openReportDesign(ReportEngineHelper.java:251)
>>> 12:10:15,661 INFO [STDOUT] at
>>> org.eclipse.birt.report.engine.api.impl.Repor
>>> tEngine.openReportDesign(ReportEngine.java:550)
>>> 12:10:15,665 INFO [STDOUT] at
>>> org.eclipse.birt.report.service.ReportEngineS
>>> ervice.openReportDesign(ReportEngineService.java:366)
>>> 12:10:15,668 INFO [STDOUT] at
>>> org.eclipse.birt.report.utility.BirtUtility.g
>>> etRunnableFromDesignFile(BirtUtility.java:590)
>>> 12:10:15,671 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.ViewerAttribu
>>> teBean.getDesignHandle(ViewerAttributeBean.java:641)
>>> 12:10:15,673 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.ViewerAttribu
>>> teBean.__init(ViewerAttributeBean.java:227)
>>> 12:10:15,676 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.BaseAttribute
>>> Bean.init(BaseAttributeBean.java:243)
>>> 12:10:15,679 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.ViewerAttribu
>>> teBean.<init>(ViewerAttributeBean.java:112)
>>> 12:10:15,681 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.BirtContext._
>>> _init(BirtContext.java:44)
>>> 12:10:15,683 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.BaseContext.<
>>> init>(BaseContext.java:69)
>>> 12:10:15,686 INFO [STDOUT] at
>>> org.eclipse.birt.report.context.BirtContext.<
>>> init>(BirtContext.java:30)
>>> 12:10:15,687 INFO [STDOUT] at
>>> org.eclipse.birt.report.servlet.ViewerServlet
>>> .__getContext(ViewerServlet.java:150)
>>> 12:10:15,689 INFO [STDOUT] at
>>> org.eclipse.birt.report.servlet.BirtSoapMessa
>>> geDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.j ava:137)
>>> 12:10:15,691 INFO [STDOUT] at
>>> javax.servlet.http.HttpServlet.service(HttpSe
>>> rvlet.java:697)
>>> 12:10:15,693 INFO [STDOUT] at
>>> org.apache.axis.transport.http.AxisServletBas
>>> e.service(AxisServletBase.java:327)
>>> 12:10:15,696 INFO [STDOUT] at
>>> javax.servlet.http.HttpServlet.service(HttpSe
>>> rvlet.java:810)
>>> 12:10:15,697 INFO [STDOUT] at
>>> org.eclipse.birt.report.servlet.BirtSoapMessa
>>> geDispatcherServlet.service(BirtSoapMessageDispatcherServlet .java:112)
>>> 12:10:15,698 INFO [STDOUT] at
>>> org.apache.catalina.core.ApplicationFilterCha
>>> in.internalDoFilter(ApplicationFilterChain.java:237)
>>> 12:10:15,702 INFO [STDOUT] at
>>> org.apache.catalina.core.ApplicationFilterCha
>>> in.doFilter(ApplicationFilterChain.java:157)
>>> 12:10:15,703 INFO [STDOUT] at
>>> org.eclipse.birt.report.filter.ViewerFilter.d
>>> oFilter(ViewerFilter.java:68)
>>> 12:10:15,704 INFO [STDOUT] at
>>> org.apache.catalina.core.ApplicationFilterCha
>>> in.internalDoFilter(ApplicationFilterChain.java:186)
>>> 12:10:15,707 INFO [STDOUT] at
>>> org.apache.catalina.core.ApplicationFilterCha
>>> in.doFilter(ApplicationFilterChain.java:157)
>>> 12:10:15,709 INFO [STDOUT] at
>>> org.jboss.web.tomcat.filters.ReplyHeaderFilte
>>> r.doFilter(ReplyHeaderFilter.java:75)
>>> 12:10:15,712 INFO [STDOUT] at
>>> org.apache.catalina.core.ApplicationFilterCha
>>> in.internalDoFilter(ApplicationFilterChain.java:186)
>>> 12:10:15,714 INFO [STDOUT] at
>>> org.apache.catalina.core.ApplicationFilterCha
>>> in.doFilter(ApplicationFilterChain.java:157)
>>> 12:10:15,718 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardWrapperValve
>>> .invoke(StandardWrapperValve.java:214)
>>> 12:10:15,720 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:104)
>>> 12:10:15,721 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardPipeline.inv
>>> oke(StandardPipeline.java:520)
>>> 12:10:15,725 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardContextValve
>>> .invokeInternal(StandardContextValve.java:198)
>>> 12:10:15,727 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardContextValve
>>> .invoke(StandardContextValve.java:152)
>>> 12:10:15,728 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:104)
>>> 12:10:15,729 INFO [STDOUT] at
>>> org.jboss.web.tomcat.security.CustomPrincipal
>>> Valve.invoke(CustomPrincipalValve.java:44)
>>> 12:10:15,730 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:102)
>>> 12:10:15,731 INFO [STDOUT] at
>>> org.jboss.web.tomcat.security.SecurityAssocia
>>> tionValve.invoke(SecurityAssociationValve.java:169)
>>> 12:10:15,734 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:102)
>>> 12:10:15,735 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardPipeline.inv
>>> oke(StandardPipeline.java:520)
>>> 12:10:15,736 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardHostValve.in
>>> voke(StandardHostValve.java:137)
>>> 12:10:15,738 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:104)
>>> 12:10:15,740 INFO [STDOUT] at
>>> org.apache.catalina.valves.ErrorReportValve.i
>>> nvoke(ErrorReportValve.java:118)
>>> 12:10:15,741 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:102)
>>> 12:10:15,743 INFO [STDOUT] at
>>> org.jboss.web.tomcat.tc5.jca.CachedConnection
>>> Valve.invoke(CachedConnectionValve.java:139)
>>> 12:10:15,745 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:102)
>>> 12:10:15,748 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardPipeline.inv
>>> oke(StandardPipeline.java:520)
>>> 12:10:15,749 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardEngineValve.
>>> invoke(StandardEngineValve.java:109)
>>> 12:10:15,751 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardValveContext
>>> .invokeNext(StandardValveContext.java:104)
>>> 12:10:15,754 INFO [STDOUT] at
>>> org.apache.catalina.core.StandardPipeline.inv
>>> oke(StandardPipeline.java:520)
>>> 12:10:15,756 INFO [STDOUT] at
>>> org.apache.catalina.core.ContainerBase.invoke
>>> (ContainerBase.java:929)
>>> 12:10:15,757 INFO [STDOUT] at
>>> org.apache.coyote.tomcat5.CoyoteAdapter.servi
>>> ce(CoyoteAdapter.java:160)
>>> 12:10:15,760 INFO [STDOUT] at
>>> org.apache.coyote.http11.Http11Processor.proc
>>> ess(Http11Processor.java:799)
>>> 12:10:15,761 INFO [STDOUT] at
>>> org.apache.coyote.http11.Http11Protocol$Http1
>>> 1ConnectionHandler.processConnection(Http11Protocol.java:705 )
>>> 12:10:15,763 INFO [STDOUT] at
>>> org.apache.tomcat.util.net.TcpWorkerThread.ru
>>> nIt(PoolTcpEndpoint.java:577)
>>> 12:10:15,766 INFO [STDOUT] at
>>> org.apache.tomcat.util.threads.ThreadPool$Con
>>> trolRunnable.run(ThreadPool.java:683)
>>> 12:10:15,767 INFO [STDOUT] at java.lang.Thread.run(Thread.java:619)
>>> >>
>>>
>>> war application code :
>>> <<
>>> String reportName = req.getParameter("report_name");
>>>
>>> EngineConfig engConfig = new EngineConfig();
>>> engConfig.setEngineHome("");
>>>
>>> IPlatformContext context = new PlatformServletContext(
>>> getServletContext() );
>>>
>>> Platform.startup(engConfig);
>>>
>>> IReportEngineFactory factory = (IReportEngineFactory)
>>> Platform.createFactoryObject(
>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>> IReportEngine engine = factory.createReportEngine( engConfig );
>>> engine.changeLogLevel( Level.WARNING );
>>>
>>> IReportRunnable report = engine.openReportDesign("c:/" +
>>> reportName);
>>>
>>> //Create task to run and render the report,
>>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>>> //Set parent classloader for engine
>>>
>>> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY,
>>> this.getClass().getClassLoader());
>>>
>>> //Setup rendering to HTML/Excel
>>>
>>> HTMLRenderOption options = new HTMLRenderOption();
>>> options.setOutputStream(resp.getOutputStream());
>>> options.setOutputFormat("html");
>>> resp.setContentType("dummyNameForSaveDialogOpening/Test");
>>> options.setImageDirectory(c:/images);
>>> options.setBaseImageURL("http://localhost/images");
>>> options.setImageHandler(new HTMLServerImageHandler());
>>> options.setEmbeddable(false);
>>> task.setRenderOption(options);
>>> task.run();
>>> task.close();
>>>
>>> engine.destroy();
>>> Platform.shutdown();
>>> >>
>>>
>>> If I remove the Platform.shutdown() it works but there are some
>>> memory leaks.
>>>
>>> So do you have a solution to have a WAR application which is using
>>> Birt API and birt viewer on the same application server (jboss or
>>> tomcat) ?
>>>
>>>
>>> Regards,
>>> Blured.
Re: Having birt.war & other application running on same application server [message #365053 is a reply to message #365048] Mon, 08 September 2008 12:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: moi.toto.com

Thanks a lot for this servlet example.

So I can presume that the birt engine is not the same having this
servlet and birt-viewer on the same application server ?

The "Platform.startup(config)" applied to 2 servlets with the same
informations in config object will generate 2 runtime of birt platform
or will it use the same runtime ?

Regards,
Blured.

Jason Weathersby a écrit :
> Moi,
>
> Take a look at this example:
> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1
>
> Jason
>
> moi wrote:
>> Hello,
>>
>> I'm making more test to see if the memory leak is still there or not.
>>
>> The platform start up & shutdown also occurs with web viewer each time
>> it is launched is'nt it ? If it is the case how can I modify it to
>> launch the platform only on the startup of application and close it
>> when the application is powered off ?
>>
>> Is the Birt engine shared by all application (war) on an application
>> server if we use
>> <<
>> EngineConfig engConfig = new EngineConfig();
>> engConfig.setEngineHome("");
>>
>> IPlatformContext context = new PlatformServletContext(
>> getServletContext() );
>> Platform.startup(engConfig);
>> >>
>> Or does it launch a specific engine instance ?
>>
>>
>> It seems that as soon as I call
>> <<
>> engine.destroy();
>> Platform.shutdown();
>> >> in my specific war, there is something missing for the birt-viewer.
>>
>> Regards,
>> Blured.
>>
>> Jason Weathersby a écrit :
>>> Moi,
>>>
>>> I have not tried this, but you may be able to point the API BIRT_HOME
>>> to the location of the Platform directory for the webviewer and do
>>> not use a PlatformServletContext. BTW Platform start up and
>>> shutdown should only happen once for your app. It is very
>>> inefficient to start and stop for every request. Also only destroy
>>> the engine on shutdown of the app. Can you give some more detail on
>>> the memory leak?
>>>
>>> Jason
>>>
>>> moi wrote:
>>>> Hello,
>>>>
>>>> When using Birt-viewer and another war application which use BIRT
>>>> API, I've got this error based on those steps :
>>>> . Access application which is using birt API
>>>> . Access to birt viewer
>>>>
>>>> Error :
>>>> <<
>>>> 12:10:15,654 INFO [STDOUT] at
>>>> org.eclipse.birt.report.model.api.DesignEngin
>>>> e.newSessionHandle(DesignEngine.java:108)
>>>> 12:10:15,656 INFO [STDOUT] at
>>>> org.eclipse.birt.report.engine.parser.ReportP
>>>> arser.getDesignHandle(ReportParser.java:143)
>>>> 12:10:15,657 INFO [STDOUT] at
>>>> org.eclipse.birt.report.engine.api.impl.Repor
>>>> tEngineHelper.openReportDesign(ReportEngineHelper.java:251)
>>>> 12:10:15,661 INFO [STDOUT] at
>>>> org.eclipse.birt.report.engine.api.impl.Repor
>>>> tEngine.openReportDesign(ReportEngine.java:550)
>>>> 12:10:15,665 INFO [STDOUT] at
>>>> org.eclipse.birt.report.service.ReportEngineS
>>>> ervice.openReportDesign(ReportEngineService.java:366)
>>>> 12:10:15,668 INFO [STDOUT] at
>>>> org.eclipse.birt.report.utility.BirtUtility.g
>>>> etRunnableFromDesignFile(BirtUtility.java:590)
>>>> 12:10:15,671 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.ViewerAttribu
>>>> teBean.getDesignHandle(ViewerAttributeBean.java:641)
>>>> 12:10:15,673 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.ViewerAttribu
>>>> teBean.__init(ViewerAttributeBean.java:227)
>>>> 12:10:15,676 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.BaseAttribute
>>>> Bean.init(BaseAttributeBean.java:243)
>>>> 12:10:15,679 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.ViewerAttribu
>>>> teBean.<init>(ViewerAttributeBean.java:112)
>>>> 12:10:15,681 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.BirtContext._
>>>> _init(BirtContext.java:44)
>>>> 12:10:15,683 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.BaseContext.<
>>>> init>(BaseContext.java:69)
>>>> 12:10:15,686 INFO [STDOUT] at
>>>> org.eclipse.birt.report.context.BirtContext.<
>>>> init>(BirtContext.java:30)
>>>> 12:10:15,687 INFO [STDOUT] at
>>>> org.eclipse.birt.report.servlet.ViewerServlet
>>>> .__getContext(ViewerServlet.java:150)
>>>> 12:10:15,689 INFO [STDOUT] at
>>>> org.eclipse.birt.report.servlet.BirtSoapMessa
>>>> geDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.j ava:137)
>>>> 12:10:15,691 INFO [STDOUT] at
>>>> javax.servlet.http.HttpServlet.service(HttpSe
>>>> rvlet.java:697)
>>>> 12:10:15,693 INFO [STDOUT] at
>>>> org.apache.axis.transport.http.AxisServletBas
>>>> e.service(AxisServletBase.java:327)
>>>> 12:10:15,696 INFO [STDOUT] at
>>>> javax.servlet.http.HttpServlet.service(HttpSe
>>>> rvlet.java:810)
>>>> 12:10:15,697 INFO [STDOUT] at
>>>> org.eclipse.birt.report.servlet.BirtSoapMessa
>>>> geDispatcherServlet.service(BirtSoapMessageDispatcherServlet .java:112)
>>>> 12:10:15,698 INFO [STDOUT] at
>>>> org.apache.catalina.core.ApplicationFilterCha
>>>> in.internalDoFilter(ApplicationFilterChain.java:237)
>>>> 12:10:15,702 INFO [STDOUT] at
>>>> org.apache.catalina.core.ApplicationFilterCha
>>>> in.doFilter(ApplicationFilterChain.java:157)
>>>> 12:10:15,703 INFO [STDOUT] at
>>>> org.eclipse.birt.report.filter.ViewerFilter.d
>>>> oFilter(ViewerFilter.java:68)
>>>> 12:10:15,704 INFO [STDOUT] at
>>>> org.apache.catalina.core.ApplicationFilterCha
>>>> in.internalDoFilter(ApplicationFilterChain.java:186)
>>>> 12:10:15,707 INFO [STDOUT] at
>>>> org.apache.catalina.core.ApplicationFilterCha
>>>> in.doFilter(ApplicationFilterChain.java:157)
>>>> 12:10:15,709 INFO [STDOUT] at
>>>> org.jboss.web.tomcat.filters.ReplyHeaderFilte
>>>> r.doFilter(ReplyHeaderFilter.java:75)
>>>> 12:10:15,712 INFO [STDOUT] at
>>>> org.apache.catalina.core.ApplicationFilterCha
>>>> in.internalDoFilter(ApplicationFilterChain.java:186)
>>>> 12:10:15,714 INFO [STDOUT] at
>>>> org.apache.catalina.core.ApplicationFilterCha
>>>> in.doFilter(ApplicationFilterChain.java:157)
>>>> 12:10:15,718 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardWrapperValve
>>>> .invoke(StandardWrapperValve.java:214)
>>>> 12:10:15,720 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:104)
>>>> 12:10:15,721 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardPipeline.inv
>>>> oke(StandardPipeline.java:520)
>>>> 12:10:15,725 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardContextValve
>>>> .invokeInternal(StandardContextValve.java:198)
>>>> 12:10:15,727 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardContextValve
>>>> .invoke(StandardContextValve.java:152)
>>>> 12:10:15,728 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:104)
>>>> 12:10:15,729 INFO [STDOUT] at
>>>> org.jboss.web.tomcat.security.CustomPrincipal
>>>> Valve.invoke(CustomPrincipalValve.java:44)
>>>> 12:10:15,730 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:102)
>>>> 12:10:15,731 INFO [STDOUT] at
>>>> org.jboss.web.tomcat.security.SecurityAssocia
>>>> tionValve.invoke(SecurityAssociationValve.java:169)
>>>> 12:10:15,734 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:102)
>>>> 12:10:15,735 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardPipeline.inv
>>>> oke(StandardPipeline.java:520)
>>>> 12:10:15,736 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardHostValve.in
>>>> voke(StandardHostValve.java:137)
>>>> 12:10:15,738 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:104)
>>>> 12:10:15,740 INFO [STDOUT] at
>>>> org.apache.catalina.valves.ErrorReportValve.i
>>>> nvoke(ErrorReportValve.java:118)
>>>> 12:10:15,741 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:102)
>>>> 12:10:15,743 INFO [STDOUT] at
>>>> org.jboss.web.tomcat.tc5.jca.CachedConnection
>>>> Valve.invoke(CachedConnectionValve.java:139)
>>>> 12:10:15,745 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:102)
>>>> 12:10:15,748 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardPipeline.inv
>>>> oke(StandardPipeline.java:520)
>>>> 12:10:15,749 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardEngineValve.
>>>> invoke(StandardEngineValve.java:109)
>>>> 12:10:15,751 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardValveContext
>>>> .invokeNext(StandardValveContext.java:104)
>>>> 12:10:15,754 INFO [STDOUT] at
>>>> org.apache.catalina.core.StandardPipeline.inv
>>>> oke(StandardPipeline.java:520)
>>>> 12:10:15,756 INFO [STDOUT] at
>>>> org.apache.catalina.core.ContainerBase.invoke
>>>> (ContainerBase.java:929)
>>>> 12:10:15,757 INFO [STDOUT] at
>>>> org.apache.coyote.tomcat5.CoyoteAdapter.servi
>>>> ce(CoyoteAdapter.java:160)
>>>> 12:10:15,760 INFO [STDOUT] at
>>>> org.apache.coyote.http11.Http11Processor.proc
>>>> ess(Http11Processor.java:799)
>>>> 12:10:15,761 INFO [STDOUT] at
>>>> org.apache.coyote.http11.Http11Protocol$Http1
>>>> 1ConnectionHandler.processConnection(Http11Protocol.java:705 )
>>>> 12:10:15,763 INFO [STDOUT] at
>>>> org.apache.tomcat.util.net.TcpWorkerThread.ru
>>>> nIt(PoolTcpEndpoint.java:577)
>>>> 12:10:15,766 INFO [STDOUT] at
>>>> org.apache.tomcat.util.threads.ThreadPool$Con
>>>> trolRunnable.run(ThreadPool.java:683)
>>>> 12:10:15,767 INFO [STDOUT] at
>>>> java.lang.Thread.run(Thread.java:619)
>>>> >>
>>>>
>>>> war application code :
>>>> <<
>>>> String reportName = req.getParameter("report_name");
>>>>
>>>> EngineConfig engConfig = new EngineConfig();
>>>> engConfig.setEngineHome("");
>>>>
>>>> IPlatformContext context = new PlatformServletContext(
>>>> getServletContext() );
>>>>
>>>> Platform.startup(engConfig);
>>>>
>>>> IReportEngineFactory factory = (IReportEngineFactory)
>>>> Platform.createFactoryObject(
>>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>>> IReportEngine engine = factory.createReportEngine( engConfig );
>>>> engine.changeLogLevel( Level.WARNING );
>>>>
>>>> IReportRunnable report = engine.openReportDesign("c:/" +
>>>> reportName);
>>>>
>>>> //Create task to run and render the report,
>>>> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
>>>> //Set parent classloader for engine
>>>>
>>>> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY,
>>>> this.getClass().getClassLoader());
>>>>
>>>> //Setup rendering to HTML/Excel
>>>>
>>>> HTMLRenderOption options = new HTMLRenderOption();
>>>> options.setOutputStream(resp.getOutputStream());
>>>> options.setOutputFormat("html");
>>>> resp.setContentType("dummyNameForSaveDialogOpening/Test");
>>>> options.setImageDirectory(c:/images);
>>>> options.setBaseImageURL("http://localhost/images");
>>>> options.setImageHandler(new HTMLServerImageHandler());
>>>> options.setEmbeddable(false);
>>>> task.setRenderOption(options);
>>>> task.run();
>>>> task.close();
>>>>
>>>> engine.destroy();
>>>> Platform.shutdown();
>>>> >>
>>>>
>>>> If I remove the Platform.shutdown() it works but there are some
>>>> memory leaks.
>>>>
>>>> So do you have a solution to have a WAR application which is using
>>>> Birt API and birt viewer on the same application server (jboss or
>>>> tomcat) ?
>>>>
>>>>
>>>> Regards,
>>>> Blured.
Re: Having birt.war & other application running on same application server [message #365057 is a reply to message #365053] Mon, 08 September 2008 13:40 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Moi,

If you set the birt home to the same in both, and you startup just one
of them, the second one should be bale to use the static Platform class
to make calls including creating the report engine.

Jason

moi wrote:
> Thanks a lot for this servlet example.
>
> So I can presume that the birt engine is not the same having this
> servlet and birt-viewer on the same application server ?
>
> The "Platform.startup(config)" applied to 2 servlets with the same
> informations in config object will generate 2 runtime of birt platform
> or will it use the same runtime ?
>
> Regards,
> Blured.
>
> Jason Weathersby a écrit :
>> Moi,
>>
>> Take a look at this example:
>> http://wiki.eclipse.org/Servlet_Example_%28BIRT%29_2.1
>>
>> Jason
>>
>> moi wrote:
>>> Hello,
>>>
>>> I'm making more test to see if the memory leak is still there or not.
>>>
>>> The platform start up & shutdown also occurs with web viewer each
>>> time it is launched is'nt it ? If it is the case how can I modify it
>>> to launch the platform only on the startup of application and close
>>> it when the application is powered off ?
>>>
>>> Is the Birt engine shared by all application (war) on an application
>>> server if we use
>>> <<
>>> EngineConfig engConfig = new EngineConfig();
>>> engConfig.setEngineHome("");
>>>
>>> IPlatformContext context = new PlatformServletContext(
>>> getServletContext() );
>>> Platform.startup(engConfig);
>>> >>
>>> Or does it launch a specific engine instance ?
>>>
>>>
>>> It seems that as soon as I call
>>> <<
>>> engine.destroy();
>>> Platform.shutdown();
>>> >> in my specific war, there is something missing for the birt-viewer.
>>>
>>> Regards,
>>> Blured.
>>>
>>> Jason Weathersby a écrit :
>>>> Moi,
>>>>
>>>> I have not tried this, but you may be able to point the API
>>>> BIRT_HOME to the location of the Platform directory for the
>>>> webviewer and do not use a PlatformServletContext. BTW Platform
>>>> start up and shutdown should only happen once for your app. It is
>>>> very inefficient to start and stop for every request. Also only
>>>> destroy the engine on shutdown of the app. Can you give some more
>>>> detail on the memory leak?
>>>>
>>>> Jason
>>>>
>>>> moi wrote:
>>>>> Hello,
>>>>>
>>>>> When using Birt-viewer and another war application which use BIRT
>>>>> API, I've got this error based on those steps :
>>>>> . Access application which is using birt API
>>>>> . Access to birt viewer
>>>>>
>>>>> Error :
>>>>> <<
>>>>> 12:10:15,654 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.model.api.DesignEngin
>>>>> e.newSessionHandle(DesignEngine.java:108)
>>>>> 12:10:15,656 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.engine.parser.ReportP
>>>>> arser.getDesignHandle(ReportParser.java:143)
>>>>> 12:10:15,657 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.engine.api.impl.Repor
>>>>> tEngineHelper.openReportDesign(ReportEngineHelper.java:251)
>>>>> 12:10:15,661 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.engine.api.impl.Repor
>>>>> tEngine.openReportDesign(ReportEngine.java:550)
>>>>> 12:10:15,665 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.service.ReportEngineS
>>>>> ervice.openReportDesign(ReportEngineService.java:366)
>>>>> 12:10:15,668 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.utility.BirtUtility.g
>>>>> etRunnableFromDesignFile(BirtUtility.java:590)
>>>>> 12:10:15,671 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.ViewerAttribu
>>>>> teBean.getDesignHandle(ViewerAttributeBean.java:641)
>>>>> 12:10:15,673 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.ViewerAttribu
>>>>> teBean.__init(ViewerAttributeBean.java:227)
>>>>> 12:10:15,676 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.BaseAttribute
>>>>> Bean.init(BaseAttributeBean.java:243)
>>>>> 12:10:15,679 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.ViewerAttribu
>>>>> teBean.<init>(ViewerAttributeBean.java:112)
>>>>> 12:10:15,681 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.BirtContext._
>>>>> _init(BirtContext.java:44)
>>>>> 12:10:15,683 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.BaseContext.<
>>>>> init>(BaseContext.java:69)
>>>>> 12:10:15,686 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.context.BirtContext.<
>>>>> init>(BirtContext.java:30)
>>>>> 12:10:15,687 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.servlet.ViewerServlet
>>>>> .__getContext(ViewerServlet.java:150)
>>>>> 12:10:15,689 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.servlet.BirtSoapMessa
>>>>> geDispatcherServlet.doGet(BirtSoapMessageDispatcherServlet.j ava:137)
>>>>> 12:10:15,691 INFO [STDOUT] at
>>>>> javax.servlet.http.HttpServlet.service(HttpSe
>>>>> rvlet.java:697)
>>>>> 12:10:15,693 INFO [STDOUT] at
>>>>> org.apache.axis.transport.http.AxisServletBas
>>>>> e.service(AxisServletBase.java:327)
>>>>> 12:10:15,696 INFO [STDOUT] at
>>>>> javax.servlet.http.HttpServlet.service(HttpSe
>>>>> rvlet.java:810)
>>>>> 12:10:15,697 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.servlet.BirtSoapMessa
>>>>> geDispatcherServlet.service(BirtSoapMessageDispatcherServlet .java:112)
>>>>> 12:10:15,698 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ApplicationFilterCha
>>>>> in.internalDoFilter(ApplicationFilterChain.java:237)
>>>>> 12:10:15,702 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ApplicationFilterCha
>>>>> in.doFilter(ApplicationFilterChain.java:157)
>>>>> 12:10:15,703 INFO [STDOUT] at
>>>>> org.eclipse.birt.report.filter.ViewerFilter.d
>>>>> oFilter(ViewerFilter.java:68)
>>>>> 12:10:15,704 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ApplicationFilterCha
>>>>> in.internalDoFilter(ApplicationFilterChain.java:186)
>>>>> 12:10:15,707 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ApplicationFilterCha
>>>>> in.doFilter(ApplicationFilterChain.java:157)
>>>>> 12:10:15,709 INFO [STDOUT] at
>>>>> org.jboss.web.tomcat.filters.ReplyHeaderFilte
>>>>> r.doFilter(ReplyHeaderFilter.java:75)
>>>>> 12:10:15,712 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ApplicationFilterCha
>>>>> in.internalDoFilter(ApplicationFilterChain.java:186)
>>>>> 12:10:15,714 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ApplicationFilterCha
>>>>> in.doFilter(ApplicationFilterChain.java:157)
>>>>> 12:10:15,718 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardWrapperValve
>>>>> .invoke(StandardWrapperValve.java:214)
>>>>> 12:10:15,720 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:104)
>>>>> 12:10:15,721 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardPipeline.inv
>>>>> oke(StandardPipeline.java:520)
>>>>> 12:10:15,725 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardContextValve
>>>>> .invokeInternal(StandardContextValve.java:198)
>>>>> 12:10:15,727 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardContextValve
>>>>> .invoke(StandardContextValve.java:152)
>>>>> 12:10:15,728 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:104)
>>>>> 12:10:15,729 INFO [STDOUT] at
>>>>> org.jboss.web.tomcat.security.CustomPrincipal
>>>>> Valve.invoke(CustomPrincipalValve.java:44)
>>>>> 12:10:15,730 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:102)
>>>>> 12:10:15,731 INFO [STDOUT] at
>>>>> org.jboss.web.tomcat.security.SecurityAssocia
>>>>> tionValve.invoke(SecurityAssociationValve.java:169)
>>>>> 12:10:15,734 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:102)
>>>>> 12:10:15,735 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardPipeline.inv
>>>>> oke(StandardPipeline.java:520)
>>>>> 12:10:15,736 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardHostValve.in
>>>>> voke(StandardHostValve.java:137)
>>>>> 12:10:15,738 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:104)
>>>>> 12:10:15,740 INFO [STDOUT] at
>>>>> org.apache.catalina.valves.ErrorReportValve.i
>>>>> nvoke(ErrorReportValve.java:118)
>>>>> 12:10:15,741 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:102)
>>>>> 12:10:15,743 INFO [STDOUT] at
>>>>> org.jboss.web.tomcat.tc5.jca.CachedConnection
>>>>> Valve.invoke(CachedConnectionValve.java:139)
>>>>> 12:10:15,745 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:102)
>>>>> 12:10:15,748 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardPipeline.inv
>>>>> oke(StandardPipeline.java:520)
>>>>> 12:10:15,749 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardEngineValve.
>>>>> invoke(StandardEngineValve.java:109)
>>>>> 12:10:15,751 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardValveContext
>>>>> .invokeNext(StandardValveContext.java:104)
>>>>> 12:10:15,754 INFO [STDOUT] at
>>>>> org.apache.catalina.core.StandardPipeline.inv
>>>>> oke(StandardPipeline.java:520)
>>>>> 12:10:15,756 INFO [STDOUT] at
>>>>> org.apache.catalina.core.ContainerBase.invoke
>>>>> (ContainerBase.java:929)
>>>>> 12:10:15,757 INFO [STDOUT] at
>>>>> org.apache.coyote.tomcat5.CoyoteAdapter.servi
>>>>> ce(CoyoteAdapter.java:160)
>>>>> 12:10:15,760 INFO [STDOUT] at
>>>>> org.apache.coyote.http11.Http11Processor.proc
>>>>> ess(Http11Processor.java:799)
>>>>> 12:10:15,761 INFO [STDOUT] at
>>>>> org.apache.coyote.http11.Http11Protocol$Http1
>>>>> 1ConnectionHandler.processConnection(Http11Protocol.java:705 )
>>>>> 12:10:15,763 INFO [STDOUT] at
>>>>> org.apache.tomcat.util.net.TcpWorkerThread.ru
>>>>> nIt(PoolTcpEndpoint.java:577)
>>>>> 12:10:15,766 INFO [STDOUT] at
>>>>> org.apache.tomcat.util.threads.ThreadPool$Con
>>>>> trolRunnable.run(ThreadPool.java:683)
>>>>> 12:10:15,767 INFO [STDOUT] at
>>>>> java.lang.Thread.run(Thread.java:619)
>>>>> >>
>>>>>
>>>>> war application code :
>>>>> <<
>>>>> String reportName = req.getParameter("report_name");
>>>>>
>>>>> EngineConfig engConfig = new EngineConfig();
>>>>> engConfig.setEngineHome("");
>>>>>
>>>>> IPlatformContext context = new PlatformServletContext(
>>>>> getServletContext() );
>>>>>
>>>>> Platform.startup(engConfig);
>>>>>
>>>>> IReportEngineFactory factory = (IReportEngineFactory)
>>>>> Platform.createFactoryObject(
>>>>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>>>>> IReportEngine engine = factory.createReportEngine(
>>>>> engConfig );
>>>>> engine.changeLogLevel( Level.WARNING );
>>>>>
>>>>> IReportRunnable report = engine.openReportDesign("c:/" +
>>>>> reportName);
>>>>>
>>>>> //Create task to run and render the report,
>>>>> IRunAndRenderTask task =
>>>>> engine.createRunAndRenderTask(report);
>>>>> //Set parent classloader for engine
>>>>>
>>>>> task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOA DER_KEY,
>>>>> this.getClass().getClassLoader());
>>>>>
>>>>> //Setup rendering to HTML/Excel
>>>>>
>>>>> HTMLRenderOption options = new HTMLRenderOption();
>>>>> options.setOutputStream(resp.getOutputStream());
>>>>> options.setOutputFormat("html");
>>>>> resp.setContentType("dummyNameForSaveDialogOpening/Test");
>>>>> options.setImageDirectory(c:/images);
>>>>> options.setBaseImageURL("http://localhost/images");
>>>>> options.setImageHandler(new HTMLServerImageHandler());
>>>>> options.setEmbeddable(false);
>>>>> task.setRenderOption(options);
>>>>> task.run();
>>>>> task.close();
>>>>>
>>>>> engine.destroy();
>>>>> Platform.shutdown();
>>>>> >>
>>>>>
>>>>> If I remove the Platform.shutdown() it works but there are some
>>>>> memory leaks.
>>>>>
>>>>> So do you have a solution to have a WAR application which is using
>>>>> Birt API and birt viewer on the same application server (jboss or
>>>>> tomcat) ?
>>>>>
>>>>>
>>>>> Regards,
>>>>> Blured.
Previous Topic:Can not get entry named /DataEngine/NamingRelation because the archive file has,been closed. System
Next Topic:Error EMF when trying RE API + BirtViewer but not When accessing birt viewer first
Goto Forum:
  


Current Time: Thu Nov 06 01:18:48 EST 2025

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

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

Back to the top