我尝试用这个命令行在centos服务器上启动我的spring boot应用程序。
SPRING_PROFILES_ACTIVE=prd java -jar ./build/libs/port_switcher-0.0.1-SNAPSHOT.jar但我收到一条错误消息,指出该端口已在使用中。然后使用netstat查找在端口号中使用的进程列表,但没有使用端口号的进程
然后我在没有SPRING_PROFILES_ACTIVE变量的情况下重新运行我的spring boot应用程序。(忘记该变量是一个错误),此时spring boot应用程序成功运行。
我真的很想知道我的应用程序属性中存在什么问题
此命令出现错误
SPRING_PROFILES_ACTIVE=prd java -jar ./build/libs/port_switcher-0.0.1-SNAPSHOT.jar 此命令工作正常
java -jar ./build/libs/port_switcher-0.0.1-SNAPSHOT.jarapplication-prd.properties
#Server
server.address=xxx.xxx.xxx.xxx
server.port=9090
#Devtools
spring.devtools.livereload.enabled=true
spring.devtools.restart.enabled=true
# Logging
logging.level.org.springframework.web=INFO
logging.level.com.kakao.portswitcher=INFO
logging.path=logs
server.tomcat.basedir=./
server.tomcat.accesslog.enabled=true
#server.tomcat.accesslog.file-date-format=.yyyy-MM-dd
server.tomcat.accesslog.rotate=true
server.tomcat.accesslog.suffix=.log
server.tomcat.accesslog.prefix=access
server.tomcat.accesslog.directory=logs
server.tomcat.accesslog.buffered=true
#Jackson
spring.jackson.property-naming-strategy=SNAKE_CASE
# Status check file
status.file=./port_switcher_status发布于 2017-07-07 13:55:28
你能试试这个吗:
java -jar -Dspring.profiles.active=prd ./build/libs/port_switcher-0.0.1-SNAPSHOT.jar
https://stackoverflow.com/questions/44963415
复制相似问题