第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

彈簧靴。類只在 src/java/main 中運(yùn)行,在 src/java/test 中有異常

彈簧靴。類只在 src/java/main 中運(yùn)行,在 src/java/test 中有異常

繁華開滿天機(jī) 2021-09-03 14:00:41
我有一個 java/spring-boot 類@SpringBootApplication@ComponentScan(value = "ignore")@RunWith(SpringRunner.class)public class MyApplication {   @Bean   YAMLConfig myeadFromYMLFile() {      return new YAMLConfig();   }   public static void main(String[] args) throws InterruptedException {      ConfigurableApplicationContext context =          SpringApplication.run(MyApplication.class, args);      YAMLConfig myBean = context.getBean(YAMLConfig.class);      myBean.doSomething();      myBean.printApi();   }}并有配置文件,從 yml 文件讀取數(shù)據(jù)的內(nèi)容@Configuration@EnableConfigurationPropertiespublic class YAMLConfig {   @Value("${refresh.rate}")   private int refreshRate;   @Value("${datasource.apiUrl}")   private String apiUrl;   public void doSomething() {      System.out.printf("Refresh Rate : %s%n", refreshRate);   }   public void printApi() {      System.out.printf("Refresh Rate : %s%n", apiUrl);   }   public String getApiUrl() {      return apiUrl;   }}問題:當(dāng)我在 src/java/main 中運(yùn)行 MyApplication 類時,一切都很酷。但是:當(dāng)我在 src/java/test 中運(yùn)行這個類時它失敗了啟動 ApplicationContext 時出錯。要顯示條件報告,請?jiān)趩⒂谩罢{(diào)試”的情況下重新運(yùn)行您的應(yīng)用程序。2018-09-06 17:14:21.389 ERROR 16515 --- [main] osboot.SpringApplication:應(yīng)用程序運(yùn)行失敗 org.springframework.context.ApplicationContextException:無法啟動 Web 服務(wù)器;嵌套異常是 java.lang.NoClassDefFoundError: javax/servlet/http/HttpSessionIdListener at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.0.4.RELEASE .jar:2.0.4.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] 在 org .springframework.boot.web.servlet.context。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 231 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號