Java 使用DefaultStreamedContent在某些文件中返回net::ERR\u complete\u CHUNKED\u编码

Java 使用DefaultStreamedContent在某些文件中返回net::ERR\u complete\u CHUNKED\u编码,java,primefaces,xhtml,Java,Primefaces,Xhtml,我正在尝试发送一个pdf文件以在媒体pdf查看器中显示。但每次我试图显示大于500Kb的文件时,它总是返回这个错误 net::ERR_INCOMPLETE_CHUNKED_ENCODING 我使用的代码是这样的 xhtml <p:media value="#{documentPreview.file}" height="800px" width="100%" player="pdf" cache="false">Your browser can't display pdf</

我正在尝试发送一个pdf文件以在媒体pdf查看器中显示。但每次我试图显示大于500Kb的文件时,它总是返回这个错误

net::ERR_INCOMPLETE_CHUNKED_ENCODING
我使用的代码是这样的

xhtml

<p:media value="#{documentPreview.file}" height="800px" width="100%" player="pdf" cache="false">Your browser can't display pdf</p:media>

有人能帮我吗?

我让它工作了,问题是我的卡巴斯基反病毒软件不允许加载文件

public StreamedContent getFile ( ) throws IOException {
    return new DefaultStreamedContent (new FileInputStream ( filepath + "indexed_primefaces_users_guide_3_5.pdf" ), "application/pdf" );
};