当前位置: 首页 > 知识库问答 >
问题:

在Spring Boot和Heroku上获得/发布后,如何解决503(服务不可用)?

潘驰
2023-03-14

我已经在Heroku上部署了我的Spring Boot应用程序,构建成功了。但是,当我试图从邮递员那里找到终点时,却发现503服务不可用

2020-06-05T17:09:50.000000+00:00 app[api]: Build succeeded
2020-06-05T17:09:53.277483+00:00 heroku[web.1]: Starting process with command `java -Dserver.port=17183 $JAVA_OPTS -jar target/ecommerce-0.0.1-SNAPSHOT.jar`
2020-06-05T17:09:55.407426+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2020-06-05T17:09:55.411915+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2020-06-05T17:09:55.581646+00:00 app[web.1]: no main manifest attribute, in target/ecommerce-0.0.1-SNAPSHOT.jar
2020-06-05T17:09:55.622586+00:00 heroku[web.1]: Process exited with status 1
2020-06-05T17:09:55.664598+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-05T17:10:16.658626+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/api/v1/item" host=xxx.com request_id=zz fwd="80.152.42.430" dyno= connect= service= status=503 bytes= protocol=https
2020-06-05T17:10:31.186284+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/api/v1/authenticate" host=xxx.com request_id=yy fwd="80.152.42.430" dyno= connect= service= status=503 bytes= protocol=https
@Override
protected void configure(HttpSecurity http) throws Exception {
    http
            .csrf()
            .disable()
            .authorizeRequests()
            .antMatchers("/api/v1/authenticate", "/api/v1/user/registration")
            .permitAll()
            .antMatchers( "/api/v1/item", "/api/v1/item/*")
            .permitAll()
            .anyRequest()
            .authenticated()
            .and()
            .exceptionHandling()
            .and()
            .sessionManagement()
            .sessionCreationPolicy(SessionCreationPolicy.STATELESS);
    http.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);
}
web: java $JAVA_OPTS -jar target/ecommerce-0.0.1-SNAPSHOT.jar -Dserver.port=$PORT

更新

这是我在《邮递员》上看到的回应:

<!DOCTYPE html>
<html>

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <title>Application Error</title>
    <style media="screen">
        html,
        body,
        iframe {
            margin: 0;
            padding: 0;
        }

        html,
        body {
            height: 100%;
            overflow: hidden;
        }

        iframe {
            width: 100%;
            height: 100%;
            border: 0;
        }
    </style>
</head>

<body>
    <iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
</body>

</html>

共有1个答案

柳向明
2023-03-14

日志在第5行没有显示主清单属性,这可以通过使用

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

原来回答在这里

 类似资料:
  • 当我在我的服务器上用wget、curl或python爬行谷歌搜索引擎时,我遇到了一个非常奇怪的问题。Google将我重定向到以[ipv4 | ipv6]开头的地址。谷歌。fr/抱歉/索引重定向。。。最后发送503错误,服务不可用。。。 有时抓取工作正常,有时不是在白天,我尝试了几乎所有可能的方法:强制ipv4/ipv6而不是主机名、引用者、用户代理、vpn、. com/. fr/、代理和tor,.

  • 线程名称:线程组1-1样本开始:2022-04-26 14:22:39 IST加载时间:230连接时间:159延迟:226字节大小:11283发送字节:498字节标头大小:797字节主体大小:10486样本计数:1错误计数:1数据类型("text"|"bin"|"):文本响应代码:503响应消息:服务暂时不可用 结果字段: 内容类型: 文本/网页;字符集 = UTF-8 数据编码:UTF-8

  • 我正在使用以下代码从带有EWS API集(Microsoft.Exchange.WebServices 2.2.0)的Office 365帐户获取日历约会: Microsoft.Exchange.WebServices.Data.ServiceRequestException:请求失败。基础连接已关闭:服务器关闭了一个预期保持活动状态的连接。---->System.Net.WebException

  • 问题内容: 我是Jetty的新手,我尝试在此处运行示例程序“ http://www.codeproject.com/Articles/128145/Run- Jetty-Web-Server-Within-Your- Application ”,但我收到了错误消息我的页面“ http:// localhost:8585 / runJetty / ” 我从Eclipse获取的错误日志: 我的xml文

  • 我正在尝试使用docker-compose和jwilder/nginx-proxy以及letsencrypt companion构建一个web应用程序,但是当我尝试时,nginx向我抛出一个503错误。 我的web应用程序是用react构建的,我制作了这个Dockerfile来构建容器映像: 这是此映像使用的nginx.config: web应用程序映像工作良好,我可以打开它,如果我只运行这个。问

  • 问题内容: 我一直在使用亚马逊的产品广告API来生成包含给定书籍价格的网址。我生成的一个网址如下: http://www.amazon.com/gp/offer- listing/0415376327%3FSubscriptionId%3DAKIAJZY2VTI5JQ66K7QQ%26tag%3Damaztest04-20%26linkCode%3Dxm2%26camp%3D2025%26crea