pe:documentViewer no work with primefaces 5.1

ぃ、小莉子 提交于 2019-12-24 16:52:53

问题


pe:documentViewer doesn't work with primefaces 5.1. This code works good with PF 5.0, but in PF 5.1 shows this error:

javax.servlet.ServletException: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; Causa Raíz

java.lang.NoSuchMethodError: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String;

Facelets code:

<p:dialog  resizable="false" closeOnEscape="true"  appendTo="@(body)" modal="true" id="dialog2" header="Detalles de la factura" widgetVar="servDialog2" width="1000px" height="630px">  
    <pe:documentViewer cache="false" height="600" value="#{listadoFacturasMB.fileDownload}"/>                                            
</p:dialog>

Información: Exception when handling error trying to reset the response. java.lang.NoSuchMethodError: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.getDocumentSource(DocumentViewerRenderer.java:116) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.generateSrc(DocumentViewerRenderer.java:49) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.encodeMarkup(DocumentViewerRenderer.java:41) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.encodeEnd(DocumentViewerRenderer.java:27) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:180) at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:109) at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:47) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206) at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123) at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:81) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:744)

Advertencia: JSF1087: no se puede generar la página de error de Facelets dado que la respuesta ya se ha confirmado. Grave: javax.faces.FacesException: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; javax.faces.FacesException: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:141) at javax.faces.context.ExceptionHandlerWrapper.handle(ExceptionHandlerWrapper.java:100) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.NoSuchMethodError: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.getDocumentSource(DocumentViewerRenderer.java:116) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.generateSrc(DocumentViewerRenderer.java:49) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.encodeMarkup(DocumentViewerRenderer.java:41) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.encodeEnd(DocumentViewerRenderer.java:27) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:180) at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:109) at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:47) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206) at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123) at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:81) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) ... 29 more

FATAL: JSF1073: se ha interceptado java.lang.NoSuchMethodError durante el procesamiento de RENDER_RESPONSE 6 : UIComponent-ClientId=, Mensaje=org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; FATAL: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; java.lang.NoSuchMethodError: org.primefaces.util.DynamicResourceBuilder.build(Ljavax/faces/context/FacesContext;Ljava/lang/Object;Ljavax/faces/component/UIComponent;Z)Ljava/lang/String; at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.getDocumentSource(DocumentViewerRenderer.java:116) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.generateSrc(DocumentViewerRenderer.java:49) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.encodeMarkup(DocumentViewerRenderer.java:41) at org.primefaces.extensions.component.documentviewer.DocumentViewerRenderer.encodeEnd(DocumentViewerRenderer.java:27) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.dialog.DialogRenderer.encodeContent(DialogRenderer.java:180) at org.primefaces.component.dialog.DialogRenderer.encodeMarkup(DialogRenderer.java:109) at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:47) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:83) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206) at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123) at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:81) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:443) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188) at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544) at java.lang.Thread.run(Thread.java:744)


回答1:


You need to upgrade your extensions to PrimeFaces Extensions 3.1.0.

See Release Notes




回答2:


Try use @SessionScoped in yours class bean listadoFacturasMB instead @ViewScoped



来源:https://stackoverflow.com/questions/28464375/pedocumentviewer-no-work-with-primefaces-5-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!