I have a Spring Boot application which should start on port 8090
. In my application.yml
I set the set these parameter :
spring:
application:
name: reactive-user
server:
port: 8090
h2:
console:
enabled: true
path: /h2-console
main:
allow-bean-definition-overriding: true
r2dbc:
url: r2dbc:h2:mem:///myusers
username: sa
password: password
sql:
init:
platform: h2
mode: always
But when the application start I see this log :
Tomcat started on port 8080 (http) with context path '/'
At the beginning the Spring Initializer generate an application.properties
and I rename it in application.yaml
. I have only one configuration file.
Is anyone can help me on this issue.
1
you need to set config like below :
server:
port: 8090
configuration should start server tag. dont put it under spring tag.
if you want to add context-path then config like below:
server:
servlet:
context-path: /reactive-user
port: 8090
0
Cannot resolve configuration property ‘spring.server.port’
spring:
server:
port: 8090
不是在spring下面,以上是错误的,以下是正确的
spring:
server:
port: 8090
Pixie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1