关于Jboot读取不到配置文件

在项目中修改端口,但是启动后还是默认8080!

 

配置文件中如下:

#type default undertow (support:undertow)

jboot.server.type=undertow

jboot.server.host=

jboot.server.port=9111

jboot.server.contextPath=

怎么看都对呀!

找到JbootServiceConfig类发现

@PropertyConfig(

    prefix = "AAA.server"

)

public class JbootServerConfig {

    public static final String TYPE_UNDERTOW = "undertow";

    public static final String TYPE_TOMCAT = "tomcat";

    public static final String TYPE_JETTY = "jetty";

    private String type = "undertow";

    private String host = "0.0.0.0";

    private int port = 8080;

    private String contextPath = "/";

 

    public JbootServerConfig() {

    }

//省略get,set

}

发现有默认值,但是也不影响我修改啊!

后来发现是配置中字头和JbootServiceConfig类里注解中prefix 的值不对应!

修改后就可以了:

AAA.server.port=9111

记录个错误浏览器崩三次,我也是厉害了!

你可能感兴趣的:(日常问题)