寫完saveUser 方法后啟動工程報錯
Failed to parse configuration class [com.springboot.SpringbooteApplication]; nested exception is java.io.FileNotFoundException: class path resource [resource.properties] cannot be opened because it does not exist

Failed to parse configuration class [com.springboot.SpringbooteApplication]; nested exception is java.io.FileNotFoundException: class path resource [resource.properties] cannot be opened because it does not exist

2018-05-21
舉報
2018-06-14
工程路徑建議不要中文
2018-06-05
工程結構如圖,注釋
package?com.springboot.pojo;import?org.springframework.boot.context.properties.ConfigurationProperties;import?org.springframework.context.annotation.Configuration;import?org.springframework.context.annotation.PropertySource;//讀配置文件中內容一定要先maven編譯一遍!!!!!!//.properties配置文件映射類//@Configuration?表示引用資源文件@Configuration//配置文件前綴@ConfigurationProperties(prefix="com.springboot.opensource")//resource.properties?文件路徑@PropertySource(value="classpath:resource.properties")public?class?Resource?{ private?String?name; private?String?website; private?String?language; public?String?getName()?{ return?name; } public?void?setName(String?name)?{ this.name?=?name; } public?String?getWebsite()?{ return?website; } public?void?setWebsite(String?website)?{ this.website?=?website; } public?String?getLanguage()?{ return?language; } public?void?setLanguage(String?language)?{ this.language?=?language; }}2018-06-05
Failed to parse configuration class [com.springboot.SpringbooteApplication]; nested exception is java.io.FileNotFoundException: class path resource [resource.properties] cannot be opened because it does not exist
是哪個文件寫錯了
2018-05-22
resource.properties這個文件存在嗎?