user2867582
user2867582

Reputation:

Cant change the port for jetty

I am running googleappengine on SpringBoot, I want to change the port number from 8080. In springboot docs, you make the change in application.yml

server:
  port: 8090,

or application.properties server.port=8090.

For springboot tomcat, this works, but not for springboot jetty, googleappengine.

Upvotes: 0

Views: 708

Answers (1)

Alien
Alien

Reputation: 15908

Actually the above property should have worked irrespective of the server.

Give a try with below method (Spring boot 2.0).

@Bean
public ConfigurableServletWebServerFactory webServerFactory()
{
    JettyServletWebServerFactory factory = new JettyServletWebServerFactory();
    factory.setPort(9000);
    factory.setContextPath("/myapp");
    factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/notfound.html"));
    return factory;
}

Refer configure jetty server spring boot

Upvotes: 1

Related Questions