亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

SpringBoot沒有讀取到application.yml問題及解決

 更新時(shí)間:2023年12月08日 09:12:01   作者:禁止喧嘩  
這篇文章主要介紹了SpringBoot沒有讀取到application.yml問題及解決方案,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

1.遇到的問題

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

其實(shí)我的application.yml文件配置的一點(diǎn)問題都沒有,依賴也依賴夠了,可是還是報(bào)這個(gè)錯(cuò)。

2.發(fā)現(xiàn)問題

由于application.xml實(shí)在controller模塊下的,

結(jié)果發(fā)現(xiàn)pom.xml的配置里面有一條配置是這樣的

<packaging>pom</packaging>

由于這里配置錯(cuò)了pom導(dǎo)致我讀取不到resources的配置文件,所以才會報(bào)錯(cuò)。

3.改正

<packaging>war</packaging>

然后重新刷新maven,運(yùn)行項(xiàng)目

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論