java - Azure网站: The specified CGI application encountered an error and the server terminated the process

标签 java tomcat azure cgi

我在 Microsoft Azure 上发布了一个网站,最近我收到以下错误:“指定的 CGI 应用程序遇到错误,服务器终止了该进程。”

我的应用程序是Java应用程序并使用“最新的Tomcat 7.0”。我尝试了一些修复,但没有成功( The specified CGI application encountered an error and the server terminated the process )。我的 web.config 甚至没有这个属性。

从我的日志中我注意到 Java 应用程序没有记录任何错误,但它只是在一段时间后停止运行。当我重新启动服务器时它可以正常工作,但是一两天后,我开始收到此错误。

我以前也遇到过这个问题,但是一两个月后才出现这个错误,现在几乎每天都会出现这个错误。我没有对我的文件或服务器进行任何更改。

知道如何解决吗?

最佳答案

Azure 网站有一项称为自动修复的功能。这仅在标准模式下可用,在免费或基本模式下不可用。

您可以将服务器配置为定期重新启动。这不会解决根本原因,但可能足以让您的应用程序保持运行。 查看此 github 要点,了解如何在 web.config 文件中配置它

https://gist.github.com/SyntaxC4/0d7185b30acf477c2033#file-web-autoheal-config

Azure 网站备忘单中描述了自动修复

http://microsoftazurewebsitescheatsheet.info/

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <monitoring>
      <triggers>
        <!-- Scenario #1: Recycling based on Request Count -->
        <requests count="1000" timeInterval="00:10:00"/>
        <!-- Scenario #2: Recycling based on slow requests -->
        <slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" />
        <!-- Scenario #3: Logging an event (or recycling) based on HTTP status code(s) -->
        <statusCode>
          <add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/>
        </statusCode>
        <!-- Scenario #4: Taking custom actions (or recycling/logging) based on memory limit -->
        <memory privateBytesInKB="800000"/>
      </triggers>
      <!-- Scenario #1 & #2 Action -->
      <actions value="Recycle"/>
      <!-- Scenario #3 Action -->
      <actions value="LogEvent"/>
      <!-- Scenario #4 Action  -->
      <actions value="CustomAction">
        <customAction exe="d:\home\procdump.exe" parameters="-accepteula w3wp d:\home\w3wp_PID_%1%_" />
      </actions>
    </monitoring>
  </system.webServer>
</configuration>
<小时/>

关于java - Azure网站: The specified CGI application encountered an error and the server terminated the process,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35130780/

相关文章:

java - 无法使用 Spring 属性持有者读取属性

java - 为什么这些分号不会产生错误?

java - Java中的CompareTo函数在这种情况下做什么

java - Facebook 登录适用于 HTC Desire 但不适用于三星 Galaxy S3

windows - 在 Windows 7 上安装 j2ee 代理

azure - 在 Azure 数据工厂中解压缩 .Z 文件

python - 如何为 Durable Azure Functions 编写单元测试?

java - 如何用 Tomcat 覆盖 spring 属性参数?

java - webgoat 不能用 tomcat 8 启动

Azure PS 查询获取特定于给定资源组注册的资源提供程序