Home
Analytics
BIRT report is not working due to Servlet.service() for servlet ViewerServlet threw exception: java.
Kalai BIRT
Hi Team,<br />
<br />
We are trying to invoke a BIRT report through BIRTVieiwer in our application.<br />
We have done the following configurations in our application,<br />
1. Platform folder - configurations & Plugin<br />
2. web.xml configurations for view servlet & birt.tld<br />
<br />
When we try to launch the BIRT report it says the following issues,<br />
<br />
HTTP Status 500 - <br />
<br />
<br />
<br />
type Exception report<br />
<br />
message <br />
<br />
description The server encountered an internal error () that prevented it from fulfilling this request.<br />
<br />
exception <br />
<br />
javax.servlet.ServletException: Servlet execution threw an exception<br />
org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)<br />
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)<br />
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)<br />
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)<br />
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)<br />
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)<br />
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)<br />
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)<br />
<br />
<br />
root cause <br />
<br />
java.lang.NoClassDefFoundError: org/eclipse/birt/core/framework/eclipse/EclipseExtensionRegistry<br />
org.eclipse.birt.core.framework.eclipse.EclipsePlatform.getExtensionRegistry(EclipsePlatform.java:56)<br />
org.eclipse.birt.core.framework.eclipse.EclipsePlatform.createFactoryObject(EclipsePlatform.java:348)<br />
org.eclipse.birt.core.framework.Platform$1.run(Platform.java:269)<br />
java.security.AccessController.doPrivileged(Native Method)<br />
org.eclipse.birt.core.framework.Platform.createFactoryObject(Platform.java:265)<br />
org.eclipse.birt.report.service.ReportEngineService.setEngineContext(ReportEngineService.java:330)<br />
org.eclipse.birt.report.service.BirtViewerReportService.setContext(BirtViewerReportService.java:1022)<br />
org.eclipse.birt.report.servlet.ViewerServlet.__getContext(ViewerServlet.java:148)<br />
org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:243)<br />
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)<br />
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)<br />
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)<br />
org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)<br />
org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)<br />
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)<br />
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)<br />
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)<br />
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)<br />
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)<br />
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)<br />
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)<br />
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)<br />
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)<br />
<br />
<br />
<br />
<br />
<br />
<strong class='bbc'>Point to note is that we are using BIRT 3.7.2 which has only the following jars in BIRT runtime WEB-INF/lib<br />
<br />
1.viewservlets.jar<br />
2.com.ibm.icu_4.4.2.v20110823.jar<br />
<br />
Other jars which includes modelapi.jar,engine.api.jar & coreapi.jar were missing.<br />
<br />
It would be good to know what is the issue. And if the issue is with the jars missing then where we can get it from.<br />
Please guide on this to resolve.</strong><br />
<br />
Thanks<br />
Kalai
Find more posts tagged with
Comments
JasonW
Kalai
The 3.7.2 runtime is pojo based and does not contain a platform directory, unless you specifically downloaded the 3.7.2 osgi runtime. Which did you download?
Jason
Kalai BIRT
Hey Jason,
Thanks for the reply. It did helped on this issue. Now we are able to see the report generated. But the problem that we now facing is the PDF report doesnt open as a new window instead its getting embedded in the parent window itself. Could you please help us on this issue.
Thanks,
Kalaimani
Kalai BIRT
Hey Jason,
Thanks for the reply. It did helped on this issue. Now we are able to see the report generated. But the problem that we now facing is the PDF report doesnt open as a new window instead its getting embedded in the parent window itself. Could you please help us on this issue.
Thanks,
Kalai
JasonW
What url are you using?
Jason
Kalai BIRT
Hi Jason,
This is the what we are including in a jsp for launching the report in PDF format. The configuration works fine for other types like doc and xls.
<birt:viewer id="XXXXXXXX"
reportDesign="report/XXXXXX.rptdesign" pattern="frameset"
format="pdf" height="10" width="10">
<birt:param name="xxxxxType" value='YYYY'>
</birt:param>
</birt:viewer>
On giving the report format as doc/xls it gives dialog box which opens the Excel or Word document. While the PDF format doesnt give any dialog box for open/save option and it embeds it into the parent window.
And one more quick question, Is it possible to directly store the generated report into a place where i can read as bytes?
Thanks,
Kalaimani
Kalai BIRT
Hi Jason,
We are still facing that PDF report generation issue.
Parallely we are trying to save this file in server side through the below script,
rptdoc =
reportContext.getHttpServletRequest().getAttribute("attributeBean ").getReportDocumentName();
importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var mdocument = re.openReportDocument(rptdoc);
var options = new PDFRenderOption();
options.setOutputFormat("pdf");
options.setOutputFileName("c:/test/mytest.pdf");
var ntask = re.createRenderTask(mdocument);
ntask.setRenderOption(options);
ntask.render();
ntask.close();
But when i debug it following is the exception it throws,
TypeError: Cannot call method "getAttribute" of null (/report/method[
@name="
;afterRender"]#1)
at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:158)
at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleAfterRender(ReportScriptExecutor.java:163)
All we need here is get the byte content of the generated report. Is there any solution for this.
Please guide here.
Thanks,
Kalaimani
JasonW
The viewer tag has a reportDocument attribute that you can set to a full path if you want. Like
reportDocument=c:/temp/myrptdoc.rptdocument. On the pdf issue take a look at:
http://www.mydigitallife.info/disable-pdf-from-opening-in-web-browser-ie-firefox-opera-safari/
Jason
Kalai BIRT
Hi Jason,
We tried one more option in the afterRender method which is mentioned below,
importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var des = re.openReportDesign("C:/CurrentSummarymail.rptdesign"); //--> Let's say i have ABC.rptdesign
var ntask = re.createRunAndRenderTask(des);
var options = new PDFRenderOption();
var outputfile = "c:/test.html";
options.setOutputFileName(outputfile);
options.setOutputFormat("html");
ntask.setRenderOption(options);
ntask.run();
ntask.close()
But when executed it doesn't have any content into it. Please suggest what we can do here.
Thanks,
Kalai
Kalai BIRT
importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var des = re.openReportDesign("C:/CurrentSummarymail.rptdesign"); //--> Let's say i have ABC.rptdesign
var ntask = re.createRunAndRenderTask(des);
var options = new PDFRenderOption();
var outputfile = "c:/test.html";
options.setOutputFileName(outputfile);
options.setOutputFormat("html");
ntask.setRenderOption(options);
ntask.run();
ntask.close()
Hi Jason,
I am confused here. Whats the difference between .rptdocument and .rptdesign. As of now through eclipse i have created only the .rptdesign file. Will the above code work if i include it in afterRender method?.
Currently i am generating a excel formatted file using BIRT report. IN that report i am placing this code in the afterRender method to generate the same content as HTML.But it doesnt have the content as test.html size is 0 KB. I would like to know what i am doing is a right one
My exact requirement is to generate this report as HTML/PDF in offline (i.e) i dont want this to be generated
while doing the excel report generation. What are the options for that?
Please guide me here. I am very much appreciating your support here and thanks for all your quick reponse.
Regards,
Kalai
JasonW
I am not certain what you mean by you do not want it to be genearted while doing the excel report generation. You may want to try your code in the afterfactory. BTW
var options = new PDFRenderOption();
var outputfile = "c:/test.html";
options.setOutputFileName(outputfile);
options.setOutputFormat("html");
Do you want it as pdf or html? If you want it in pdf output it to test.pdf and set the output format to pdf.
Jason
Kalai BIRT
Hi Jason,
We made it work now through Java file.
But we have one more issue where when downloading the PDF the file generated doesnt come with .pdf extension.
Is there any way to do that. We are using IE7 to open the PDF file.
Thanks,
Kalaimani
JasonW
Are you getting this issue with the tag libs or with Java code? If you are getting the error with the tag library I believe this may be a bug. Look at this thread:
http://www.birt-exchange.org/org/forum/index.php/topic/25422-birt-report-download-as-pdf/
Jason