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

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

Spring-boot 應(yīng)用程序在啟動時不會自動部署

Spring-boot 應(yīng)用程序在啟動時不會自動部署

慕娘9325324 2023-06-08 13:58:06
我按照在線教程在 Eclipse IDE 中創(chuàng)建了一個 spring boot 基本應(yīng)用程序。當(dāng)我嘗試將該應(yīng)用程序作為 java 應(yīng)用程序運(yùn)行時,該應(yīng)用程序未部署在嵌入式 tomcat 中。我在谷歌上搜索了很多并嘗試了一些找到的解決方案。但是,沒有一個對我有用。我在這里粘貼代碼。請讓我知道任何可能的問題。代碼:-pom.xml:-<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.test</groupId><artifactId>spring-boot-example</artifactId><version>0.0.1-SNAPSHOT</version><name>Spring Boot Example</name><packaging>jar</packaging><parent>    <groupId>org.springframework.boot</groupId>    <artifactId>spring-boot-starter-parent</artifactId>    <version>2.1.7.RELEASE</version></parent><dependencies>    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-web</artifactId>    </dependency>    <dependency>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-autoconfigure</artifactId>    </dependency></dependencies>SpringBootExample.java:-package com.test;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import com.test.config.AppConfiguration;@SpringBootApplicationpublic class SpringBootExample {    public static void main(String[] args) {        System.out.println("Started main");        SpringApplication.run(AppConfiguration.class, args);        System.out.println("Ending main");    }}AppConfiguration.java:-package com.test.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import com.test.beans.SampleBean;@Configurationpublic class AppConfiguration {    @Bean    public SampleBean getSampleBean() {        return new SampleBean();    }}SampleBean.java:-package com.test.beans;public class SampleBean {    public SampleBean() {        System.out.println("In constructor of SampleBean");    }}
查看完整描述

1 回答

?
繁星coding

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超4個贊

@EnableAutoConfiguration我添加了注釋AppConfiguration.java,它開始工作了。應(yīng)用程序無法確定要ServletWebServerFactory創(chuàng)建的類型。添加上面的注釋后,它為類路徑中已經(jīng)存在的嵌入式 tomcat 創(chuàng)建了它。



查看完整回答
反對 回復(fù) 2023-06-08
  • 1 回答
  • 0 關(guān)注
  • 198 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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