Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch - Heroku

后端 未结 8 651
情话喂你
情话喂你 2020-12-31 11:39

I am trying to deploy my server on heroku. I got this error:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
<         


        
8条回答
  •  清酒与你
    2020-12-31 12:12

    Since your this is not a Spring Boot app you should do something like this:

    package introsde.document.endpoint;
    import javax.xml.ws.Endpoint;
    
    import introsde.assignment.soap.PeopleImpl;
    
    public class PeoplePublisher {
    public static String SERVER_URL = "http://localhost";
    public String port;
    public static String BASE_URL = "/ws/people";
    
    public static String getEndpointURL() {
        return SERVER_URL+":"+port+BASE_URL;
    }
    
    public static void main(String[] args) {
    
        port = Integer.valueOf(args[0]);
    
        String endpointUrl = getEndpointURL();
        System.out.println("Starting People Service...");
        System.out.println("--> Published at = "+endpointUrl);
        Endpoint.publish(endpointUrl, new PeopleImpl());
    }
    }
    

    And then on your Procfile:

    web: java $JAVA_OPTS -jar target/*.jar $PORT
    

    This way you'll bind your socket to the port Heroku is expecting you to listen at.

提交回复
热议问题