Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package

* WARNING * : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

//如果有这个错误,肯定是这里没有定义package
package org.microservice.tcbj.yytsg.gene;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableEurekaClient
@EnableFeignClients
public class GeneApplication {

    public static void main(String[] args) {
        SpringApplication.run(GeneApplication.class,args);
    }
}

加上去就能成功启动了

猜你喜欢

转载自blog.csdn.net/moshowgame/article/details/81011701