首页 > 解决方案 > WebSphere8 中 30 分钟后出现 500 内部服务器错误

问题描述

我开发了一个 Spring Batch 应用程序,并托管在一个公司 WebSphere 8.5.15 服务器中。这个应用程序的一些休息端点用于执行不同的作业,这些作业基本上是调用存储过程并执行多个数据库查询。

我使用 curl 调用端点,如下所示:

curl --insecure --request GET 'https://mycorp.server.com:1443/batch/api/job/job1?odate=050820' 

执行 30 分钟后,我收到以下回复:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>

<head>
    <title>500 Internal Server Error</title>
</head>

<body>
    <h1>Internal Server Error</h1>
    <p>The server encountered an internal error or
        misconfiguration and was unable to complete
        your request.</p>
    <p>Please contact the server administrator at
        ped@mycorp.server.com to inform them of the time this error occurred,
        and the actions you performed just before this error.</p>
    <p>More information about this error may be available
        in the server error log.</p>
    <p>Additionally, a 500 Internal Server Error
        error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body>

</html>

在处理请求 30 分钟后,我多次尝试执行并且总是收到相同的错误“500 Internal Server Error”。在日志文件中似乎一切正常,没有报告错误或异常。

标签: spring-batchwebsphere-8

解决方案


服务器偶尔无法正确响应是很常见的情况(500 错误)。您应该通过告诉您的程序在出现错误时休眠几秒钟来解决此问题,然后根据需要继续对服务器的任何调用。从本质上讲,只要承认你会遇到这样的问题并尽你所能解决它们。


推荐阅读