mikedu95
mikedu95

Reputation: 1736

Spring boot port conflicts with Jboss port?

I have a Spring boot app that runs inside a JBoss EAP 6.4.0 server with a JDK 1.7, and packaged in an EAR with maven.

Then, when I run my app (from Eclipse with Run on server > My JBoss server), It appears that the server is listening on 8080, i.e. server.port was ignored.

Also tried this:

@Component
public class CustomizationBean implements EmbeddedServletContainerCustomizer {
    @Override
    public void customize(ConfigurableEmbeddedServletContainer container) {
        container.setPort(8081);
    }
}

Simple log ensures that the method is well executed. But app still listening on 8080.

How can I get my app runing on 8081 please ? (Without changing my standalone.xml file)

I've already read the doc but that didn't help me: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-change-the-http-port

I am very new to Java.

Thanks.

Upvotes: 0

Views: 1230

Answers (1)

joshiste
joshiste

Reputation: 2687

server.port is only used by spring boot when you do a fat-jar packaging and use the embedded servlet container. So if you don't change your deployment model, you simply can't without changing your standalone.xml

you could install the STS and do a run as -> spring boot app

Upvotes: 4

Related Questions