检索 pdf 时出现意外的服务器响应 (0) [英] Unexpected server response (0) while retrieving pdf

查看:287
本文介绍了检索 pdf 时出现意外的服务器响应 (0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在使用 Amazon ec2 实例时特别收到此错误.aws 实例上的配置为 Tomcat 7,Ubuntu 16.04,内存为 8GB.当用户尝试查看 pdf 文件时会发生这种情况.在我们的应用程序中,我们有一项功能,用户只能在浏览器上查看 PDF 文件,但不能下载它.PDF 文件在同一台服务器上.我们正在使用 cors 最小配置.我们已经在本地使用 Ubuntu 进行了尝试,并且运行良好.

代码片段:

var fileSplitContent = fileName.split(".");if ($('#viewImageOnlyForm')[0] != undefined && $('#viewPdfOnlyForm')[0] != undefined) {如果 (fileSplitContent[fileSplitContent.length - 1].toLowerCase() != "pdf") {$('#imageSource').val(requestURL + $.param(inputData));$('#viewImageOnlyForm').submit();} 别的 {var requestURL = "rest/file/getCapitalRaiseFile?";$('#pdFSource').val(requestURL + $.param(inputData));$('#viewPdfOnlyForm').submit();}} 别的 {//弹出下载附件对话框downloadIFrame.attr("src", requestURL + $.param(inputData));}}

<块引用>

2017 年 1 月 4 日上午 5:07:31 org.glassfish.jersey.server.ServerRuntime$Responder writeResponse严重:将响应消息实体写入容器输出流时发生 I/O 错误.org.glassfish.jersey.server.internal.process.MappableException:org.apache.catalina.connector.ClientAbortException:java.net.SocketException:连接重置
引起:org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Broken pipe (Write failed)

解决方案

这可能是因为您在浏览器上安装了下载管理器,这取决于您访问文档的位置.这有时会导致问题 - 也许看看你的扩展.您应该尝试在浏览器中禁用下载管理器扩展.

We are specifically getting this error when using Amazon ec2 instance. Configuration on aws instance is Tomcat 7, Ubuntu 16.04 and memory is 8gb. It occurs when the user tries to view pdf file. In our application, we are having one functionality where the user can only view PDF file onto browser, but won't be able to download it. PDF file is on the same server. We are using cors minimal configuration. We have tried it locally with Ubuntu and it is working fine.

Code snippet:

var fileSplitContent = fileName.split(".");
    if ($('#viewImageOnlyForm')[0] != undefined && $('#viewPdfOnlyForm')[0] != undefined) {
        if (fileSplitContent[fileSplitContent.length - 1].toLowerCase() != "pdf") {
            $('#imageSource').val(requestURL + $.param(inputData));
            $('#viewImageOnlyForm').submit();
        } else {
            var requestURL = "rest/file/getCapitalRaiseFile?";
            $('#pdFSource').val(requestURL + $.param(inputData));
            $('#viewPdfOnlyForm').submit();
        }
    } else {
        // pop up download attachment dialog box
        downloadIFrame.attr("src", requestURL + $.param(inputData));
    }

}

Jan 04, 2017 5:07:31 AM org.glassfish.jersey.server.ServerRuntime$Responder writeResponse SEVERE: An I/O error has occurred while writing a response message entity to the container output stream. org.glassfish.jersey.server.internal.process.MappableException: org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Connection reset
Caused by: org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Broken pipe (Write failed)

解决方案

Depending where you access the document this can be because of you have a download manager installed on your browser. This sometimes causes problems - maybe take a look at your extensions. You should try by disabling downloader manager extension in your browser.

这篇关于检索 pdf 时出现意外的服务器响应 (0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆