Forums de discussion
Liferay portal 6.1 CE PDF export MIME ERRORS
Vesa Kakriainen, modifié il y a 10 années.
Liferay portal 6.1 CE PDF export MIME ERRORS
New Member Publications: 7 Date d'inscription: 21/01/14 Publications récentes
Hello,
Thank you Neil for the previous answers..
Now when I have got the primefaces 3.5 working in my liferay portal 6.1CE
I have tried many ways to print the content of primefaces Datatable or
export the data into PDF.
A ) Primefaces <p:printer> does not work.. it just reloads the page..
B ) export to PDF does not work because application/PDF mime is not supported by liferay etc..
is there a way to override liferay mime settings so that PDF can be accepted?
C ) Is there some way to implement buttoon which changes the default style to print.css etc?
I have tried to create the PDF as below:
Has anyone succeed making PDF export and how???
view.xhtml
controllerBean
My LIBs
=======================
jboss-el-2.0.0.GA.jar
jsf-api-2.1.21.jar
jsf-impl-2.1.21.jar
liferay-faces-alloy-3.1.3-ga4.jar
liferay-faces-bridge-api-3.1.3-ga4.jar
liferay-faces-bridge-impl-3.1.3-ga4.jar
liferay-faces-util-3.1.3-ga4.jar
primefaces-3.5.jar
poi-3.9.jar
flying-saucer-pdf-itext5-9.0.4.jar
itextpdf-5.5.0.jar
===========================
Thank you Neil for the previous answers..
Now when I have got the primefaces 3.5 working in my liferay portal 6.1CE
I have tried many ways to print the content of primefaces Datatable or
export the data into PDF.
A ) Primefaces <p:printer> does not work.. it just reloads the page..
B ) export to PDF does not work because application/PDF mime is not supported by liferay etc..
is there a way to override liferay mime settings so that PDF can be accepted?
C ) Is there some way to implement buttoon which changes the default style to print.css etc?
I have tried to create the PDF as below:
Has anyone succeed making PDF export and how???
view.xhtml
<p:datatable id="datatable1" border="1" value="#{orgController.lorgs}" var="item" rowkey="#{item.id}" paginator="true" rows="4" selection="#{orgController.selectedOrg}" rowsperpagetemplate="10,50,1000">
<p:column selectionMode="single" style="width:2%" />
<p:column headertext="Column1">#{item.col1}</p:column>
<p:column headertext="Column2">#{item.col2}</p:column>
<p:column headertext="Column3">#{item.col3}</p:column>
<p:column headertext="Column4">#{item.col4}</p:column>
<f:facet name="footer">
<p:commandbutton icon="ui-icon-trash" value="remove" ajax="false" action="#orgController.remove}" update="form2:datatable1" />
<h:commandlink actionlistener="#{orgController.createPDF}">
<p:graphicimage library="images" name="pdf.png" />
</h:commandlink>
</f:facet>
</p:datatable>
controllerBean
private List<organization> lorgs=null;
//Getters and setters for lorgs
...
...
public void createPDF(){
try { //catch better your exceptions, this is just an example
FacesContext context = FacesContext.getCurrentInstance();
Document document = new Document();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PdfWriter.getInstance(document, baos);
if (!document.isOpen()) {
document.open();
}
PdfPTable pdfTable = exportPDFTable();
document.add(pdfTable);
document.close();
String fileName = "exportFilename";
writePDFToResponse(context.getExternalContext(), baos, fileName);
context.responseComplete();
} catch (Exception e) {
//e.printStackTrace();
}
}
private void writePDFToResponse(ExternalContext externalContext,
ByteArrayOutputStream baos, String fileName) {
try {
externalContext.responseReset();
externalContext.setResponseContentType("application/pdf");
externalContext.setResponseHeader("Expires", "0");
externalContext.setResponseHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
externalContext.setResponseHeader("Pragma", "public");
externalContext.setResponseHeader("Content-disposition", "attachment;filename=" + fileName + ".pdf");
externalContext.setResponseContentLength(baos.size());
OutputStream out = externalContext.getResponseOutputStream();
baos.writeTo(out);
externalContext.responseFlushBuffer();
} catch (Exception e) {
//e.printStackTrace();
}
}
private PdfPTable exportPDFTable() {
int numberOfColumns = 1;
Organization item = null;
PdfPTable pdfTable = new PdfPTable(numberOfColumns);
pdfTable.setWidthPercentage(100);
BaseFont helvetica = null;
try {
helvetica = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.EMBEDDED);
} catch (Exception e) {
//font exception
}
Font font = new Font(helvetica, 8, Font.NORMAL);
pdfTable.addCell(new Paragraph("columnName", font));
for (int i = 0; i < lorgs.size(); i++) {
// Datatable item
. item = new Organization();
item = lorgs.get(i);
//pdfTable.addCell(new Paragraph('any_string_field', font));
pdfTable.addCell(new Paragraph(item.getCol1(), font));
pdfTable.addCell(new Paragraph(item.getCol2(), font));
pdfTable.addCell(new Paragraph(item.getCol3(), font));
}
return pdfTable;
}
</organization>
My LIBs
=======================
jboss-el-2.0.0.GA.jar
jsf-api-2.1.21.jar
jsf-impl-2.1.21.jar
liferay-faces-alloy-3.1.3-ga4.jar
liferay-faces-bridge-api-3.1.3-ga4.jar
liferay-faces-bridge-impl-3.1.3-ga4.jar
liferay-faces-util-3.1.3-ga4.jar
primefaces-3.5.jar
poi-3.9.jar
flying-saucer-pdf-itext5-9.0.4.jar
itextpdf-5.5.0.jar
===========================
Kyle Joseph Stiemann, modifié il y a 10 années.
RE: Liferay portal 6.1 CE PDF export MIME ERRORS
Liferay Master Publications: 760 Date d'inscription: 14/01/13 Publications récentes
Hi Vesa,
Could you post your stacktrace for us?
Thanks,
- Kyle
Could you post your stacktrace for us?
Thanks,
- Kyle
Vesa Kakriainen, modifié il y a 10 années.
RE: Liferay portal 6.1 CE PDF export MIME ERRORS
New Member Publications: 7 Date d'inscription: 21/01/14 Publications récentesKyle Joseph Stiemann:
Hi Vesa,
Could you post your stacktrace for us?
Thanks,
- Kyle
08:54:20,425 WARN [ExternalContextCompatImpl:175] Unable to call portletRespons e.addProperty(String, String) for portletResponse=[com.liferay.portlet.ActionRes ponseImpl] because it is not a ResourceResponse.
08:54:20,427 WARN [ExternalContextCompatImpl:175] Unable to call portletRespons e.addProperty(String, String) for portletResponse=[com.liferay.portlet.ActionRes ponseImpl] because it is not a ResourceResponse.
08:54:20,427 WARN [ExternalContextCompatImpl:175] Unable to call portletRespons e.addProperty(String, String) for portletResponse=[com.liferay.portlet.ActionRes ponseImpl] because it is not a ResourceResponse.
08:54:20,428 WARN [ExternalContextCompatImpl:175] Unable to call portletRespons e.addProperty(String, String) for portletResponse=[com.liferay.portlet.ActionRes ponseImpl] because it is not a ResourceResponse.
Mar 7, 2014 8:54:20 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet 1 Servlet threw exception
javax.portlet.faces.BridgeException: java.lang.IllegalStateException: Cannot res et a buffer that has been flushed
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRen derImpl.java:91)
at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:11 2)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.ja va:255)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortle t.java:204)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100 )
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletF ilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServl et.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFil ter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD ispatcher.java:593)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis patcher.java:530)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java :534)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImp l.java:607)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java :359)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_ 005fportlet_jsp.java:1207)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequ estDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PA CLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLR equestDispatcherWrapper.java:54)
at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:5158 )
at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1569 )
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.proce ssPortlet(RuntimePortletImpl.java:165)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.proce ssPortlet(RuntimePortletImpl.java:97)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.doPro cessTemplate(RuntimePortletImpl.java:531)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.doDis patch(RuntimePortletImpl.java:394)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.proce ssTemplate(RuntimePortletImpl.java:228)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletImpl.proce ssTemplate(RuntimePortletImpl.java:216)
at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.proce ssTemplate(RuntimePortletUtil.java:113)
at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portle t_jsp.java:507)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper .java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3 90)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFil ter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD ispatcher.java:593)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis patcher.java:530)
at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAct ion.java:468)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.jav a:735)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:249)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalReques tProcessor.java:176)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:119 6)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet. java:560)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:537)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter( SecureFilter.java:294)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFil ter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp atcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica tionDispatcher.java:471)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD ispatcher.java:402)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis patcher.java:329)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServ let.java:138)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(St ripFilter.java:335)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZip Filter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter( SecureFilter.java:294)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18n Filter.java:241)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETag Filter.java:56)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processF ilter(AutoLoginFilter.java:246)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFil ter(NtlmPostFilter.java:83)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.sharepoint.SharepointFilter.processFilter(Sharepoi ntFilter.java:80)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter .java:163)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.proc essFilter(VirtualHostFilter.java:216)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java :57)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDirectCallFilter(InvokerFilterChain.java:187)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewrit eFilter.java:738)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDoFilter(InvokerFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:108)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDirectCallFilter(InvokerFilterChain.java:167)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDirectCallFilter(InvokerFilterChain.java:167)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. processDirectCallFilter(InvokerFilterChain.java:187)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:95)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFil ter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at fi.kanta.filters.OrganizationCheckerFilter.doFilter(OrganizationCheck erFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica torBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav a:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp 11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process( AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin t.java:307)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source )
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Cannot reset a buffer that has been flushed
at com.liferay.portlet.MimeResponseImpl.reset(MimeResponseImpl.java:113)
at com.liferay.faces.bridge.context.ExternalContextCompatImpl.responseRe set(ExternalContextCompatImpl.java:337)
at com.liferay.faces.bridge.context.IncongruityContextCompatImpl.makeCon gruousJSF2(IncongruityContextCompatImpl.java:130)
at com.liferay.faces.bridge.context.IncongruityContextImpl.makeCongruous (IncongruityContextImpl.java:54)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRen derImpl.java:222)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRen derImpl.java:85)
... 177 more
14-03-07 08:54:20 ERROR [IP-removed]
at com.liferay.portlet.MimeResponseImpl.reset(MimeResponseImpl.java:113)
at com.liferay.faces.bridge.context.ExternalContextCompatImpl.responseRe set(ExternalContextCompatImpl.java:337)
at com.liferay.faces.bridge.context.IncongruityContextCompatImpl.makeCon gruousJSF2(IncongruityContextCompatImpl.java:130)
at com.liferay.faces.bridge.context.IncongruityContextImpl.makeCongruous (IncongruityContextImpl.java:54)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRen derImpl.java:222)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRen derImpl.java:85)
at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:11 2)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.ja va:255)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortle t.java:204)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100 )
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletF ilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServl et.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain. doFilter(InvokerFilterChain.java:72)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFil ter(InvokerFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:243)
Another error:
java.lang.IllegalArgumentException: application/pdf is not a supported mime type
at com.liferay.portlet.MimeResponseImpl.setContentType(MimeResponseImpl.java:159)
at com.liferay.faces.bridge.container.PortletContainerImpl.setMimeResponseContentType(PortletContainerImpl.java:516)
at com.liferay.faces.bridge.context.ExternalContextCompatImpl.setResponseContentType(ExternalContextCompatImpl.java:642)
at com.liferay.faces.bridge.context.IncongruityContextCompatImpl.makeCongruousJSF2(IncongruityContextCompatImpl.java:145)
at com.liferay.faces.bridge.context.IncongruityContextImpl.makeCongruous(IncongruityContextImpl.java:54)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:222)
at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:85)
at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:112)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:255)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:204)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
Neil Griffin, modifié il y a 10 années.
RE: Liferay portal 6.1 CE PDF export MIME ERRORS
Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Hi Vesa,
Thanks for posting the stacktrace. The p:printer component is manifesting the same type of problem as p:dataExporter :
PrimeFaces invokes the bridge with a portlet ActionURL which ends up calling the ACTION_PHASE of the portlet lifecycle. Instead, PrimeFaces needs to be invoking a portlet ResourceURL so that the content can be retrieved with a JSF2 ResourceHandler.
So this is a portlet incompatibility problem that needs to be fixed in PrimeFaces.
For now, if you need to export a PDF in your application, I would recommend that you look at the jsf2-export-pdf-portlet demo.
Kind Regards,
Neil
Thanks for posting the stacktrace. The p:printer component is manifesting the same type of problem as p:dataExporter :
PrimeFaces invokes the bridge with a portlet ActionURL which ends up calling the ACTION_PHASE of the portlet lifecycle. Instead, PrimeFaces needs to be invoking a portlet ResourceURL so that the content can be retrieved with a JSF2 ResourceHandler.
So this is a portlet incompatibility problem that needs to be fixed in PrimeFaces.
For now, if you need to export a PDF in your application, I would recommend that you look at the jsf2-export-pdf-portlet demo.
Kind Regards,
Neil
Kyle Joseph Stiemann, modifié il y a 10 années.
RE: Liferay portal 6.1 CE PDF export MIME ERRORS
Liferay Master Publications: 760 Date d'inscription: 14/01/13 Publications récentes
Hi Vesa,
Unfortunately the primefaces dataExporter, fileDownload, and printer do not work in Liferay Portal due to FACES-1513. Please vote for and watch primefaces issue 1109 for more information.
- Kyle
Unfortunately the primefaces dataExporter, fileDownload, and printer do not work in Liferay Portal due to FACES-1513. Please vote for and watch primefaces issue 1109 for more information.
- Kyle
Vesa Kakriainen, modifié il y a 10 années.
RE: Liferay portal 6.1 CE PDF export MIME ERRORS
New Member Publications: 7 Date d'inscription: 21/01/14 Publications récentes
Thank you again Neil.