当前位置: 首页 > 知识库问答 >
问题:

未找到外部客户端、Spring启动应用程序和rx/可观察类错误

平山
2023-03-14

一些背景:我构建了两个Spring Boot应用程序,它们被设计成微服务。第一个应用程序(日程安排)是一个RESTful服务,它为另一个应用程序(日程安排检查器)提供数据。因此,两种服务之间存在简单的生产者-消费者关系。

在学习了使用Eureka设置microservice discovery的Spring教程之后,我有了一个Eureka服务注册表,可以成功地建立该注册表,并且日程表供应和日程表检查器服务成功地向Eureka服务注册表注册(通过检查Eureka服务的登录页进行验证)。

我现在尝试使用外国客户机设置微服务通信,即我在日程检查服务中定义了外国客户机接口,该接口应使该服务能够通过Eurekaendpoint解析与日程安排服务联系,并使用日程安排服务中的数据。但是,在将Eureka discovery服务和schedule provision服务作为Spring Boot应用程序启动后,在尝试将schedule checker服务作为Spring Boot应用程序运行时,我一直收到以下错误:

java.lang.ClassNotFoundException: rx.Observable

这是从上到下读取的错误链的根本原因:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleCheckerController': Unsatisfied dependency expressed through field 'scheduleRepository'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleRepositoryImpl': Unsatisfied dependency expressed through field 'scheduleService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleServiceImpl': Unsatisfied dependency expressed through field 'scheduleDatabaseClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.greensill.emailarrivalmonitoring.client.ScheduleDatabaseFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: rx/Observable
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1225) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE]
at com.greensill.emailarrivalmonitoring.EmailArrivalMonitoringApplication.main(EmailArrivalMonitoringApplication.java:18) [classes/:na]

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleRepositoryImpl': Unsatisfied dependency expressed through field 'scheduleService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleServiceImpl': Unsatisfied dependency expressed through field 'scheduleDatabaseClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.greensill.emailarrivalmonitoring.client.ScheduleDatabaseFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: rx/Observable
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1225) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
... 19 common frames omitted

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'scheduleServiceImpl': Unsatisfied dependency expressed through field 'scheduleDatabaseClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.greensill.emailarrivalmonitoring.client.ScheduleDatabaseFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: rx/Observable
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1225) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1136) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
... 32 common frames omitted

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.greensill.emailarrivalmonitoring.client.ScheduleDatabaseFeignClient': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: rx/Observable
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1626) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1297) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1263) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1099) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
... 45 common frames omitted

Caused by: java.lang.NoClassDefFoundError: rx/Observable
at feign.hystrix.HystrixDelegatingContract.parseAndValidatateMetadata(HystrixDelegatingContract.java:42) ~[feign-hystrix-9.3.1.jar:na]
at feign.ReflectiveFeign$ParseHandlersByName.apply(ReflectiveFeign.java:146) ~[feign-core-9.3.1.jar:na]
at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:53) ~[feign-core-9.3.1.jar:na]
at feign.Feign$Builder.target(Feign.java:209) ~[feign-core-9.3.1.jar:na]
at org.springframework.cloud.netflix.feign.HystrixTargeter.target(HystrixTargeter.java:48) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.loadBalance(FeignClientFactoryBean.java:146) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:167) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
... 55 common frames omitted

Caused by: java.lang.ClassNotFoundException: rx.Observable
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_121]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_121]
... 63 common frames omitted

据我所知,这个错误似乎是由于缺少对RxJava的依赖而导致的,rx。可观察的类不可用。但是,在向ScheduleChecker服务的pom添加RxJava依赖项之后。xml并运行mvn clean install,上述详细错误仍然存在。我不确定如何解决这个问题,因为似乎没有任何在线资源专门解决这个问题。我构建的两个微服务中的相关类/文件应支持我期望的行为(schedule checker服务通过schedule provision服务中定义的RESTendpoint使用schedule provision服务数据):

@SpringBootApplication
@EnableEurekaClient
public class EmailArrivalScheduleServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(EmailArrivalScheduleServiceApplication.class, args);
    }
}
@RestController
public class ScheduleDatabaseController {

    @Autowired
    private ScheduleDatabaseService scheduleDatabaseService;

    @RequestMapping(value="/schedules", method=RequestMethod.GET)
    public Iterable<Schedule> getSchedules(){
        return this.scheduleDatabaseService.getSchedules();
    }
}
spring:
  application:
    name: email-arrival-schedule-service

eureka:
  instance:
    prefer-ip-address: true
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableScheduling
@IntegrationComponentScan
public class EmailArrivalMonitoringApplication {

    public static void main(String args[]) {
        SpringApplication.run(EmailArrivalMonitoringApplication.class, args);
    }
}
@FeignClient("email-arrival-schedule-service")
public interface ScheduleDatabaseFeignClient {

    @RequestMapping(method = RequestMethod.GET, value = "/schedules")
    public List<Schedule> getSchedules();
}
@Service
public class ScheduleServiceImpl implements ScheduleService {

    @Autowired
    private ScheduleDatabaseFeignClient scheduleDatabaseClient;

    @Override
    public List<Schedule> getSchedules() {
        return scheduleDatabaseClient.getSchedules();
    }
}
spring:
  application:
    name: email-arrival-monitoring-service

eureka:
  instance:
    prefer-ip-address: true
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
<dependencies>
    <dependency>
        <groupId>${project.parent.groupId}</groupId>
        <artifactId>email-arrival-dto</artifactId>
        <version>${project.parent.version}</version>
    </dependency>

    <dependency>
        <groupId>io.reactivex.rxjava2</groupId>
        <artifactId>rxjava</artifactId>
        <version>2.0.8</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-integration</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-ribbon</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-feign</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.integration</groupId>
        <artifactId>spring-integration-file</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.integration</groupId>
        <artifactId>spring-integration-java-dsl</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.integration</groupId>
        <artifactId>spring-integration-mail</artifactId>
    </dependency>

    <dependency>
        <groupId>com.icegreen</groupId>
        <artifactId>greenmail-spring</artifactId>
        <version>1.5.3</version>
    </dependency>

    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <scope>test</scope>
    </dependency>

</dependencies>

共有1个答案

松俊才
2023-03-14

准备好这个问题后,我在两位同事的帮助下解决了这个问题。将作出的修改如下:

  1. RxJava被许多Spring Boot依赖项声明为依赖项,因此,应该排除这些依赖项声明的RxJava依赖项,以防止冲突

总而言之,将要进行的更改如下。关于计划检查器服务pom。xml(不是整个项目的父pom),所有其他代码仍如我的原始问题中所述:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Dalston.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>io.reactivex</groupId>
        <artifactId>rxjava</artifactId>
        <version>1.0.12</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-ribbon</artifactId>
        <exclusions>
            <exclusion>
                <groupId>io.reactivex</groupId>
                <artifactId>rxjava</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
        <exclusions>
            <exclusion>
                <groupId>io.reactivex</groupId>
                <artifactId>rxjava</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-feign</artifactId>
        <exclusions>
            <exclusion>
                <groupId>io.reactivex</groupId>
                <artifactId>rxjava</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableScheduling
@IntegrationComponentScan
@EnableAutoConfiguration(exclude = {RxJavaAutoConfiguration.class})
public class EmailArrivalMonitoringApplication {

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

最后,可能会出现这样的情况:在您的项目上运行mvn清洁安装(就像我所做的那样),并启动Eureka发现服务和应该通信的服务(在我的例子中,日程提供服务和日程检查服务)后,包含FaignClient的服务抛出异常。我不确定为什么会发生这种情况,但是,如果您终止服务并再次启动它,一切都很好。

我希望这会有所帮助,我花了大约2天的时间来纠正这个问题,我会敦促Spring Boot的相关人员快速相应地更新他们的文档!

 类似资料:
  • 我创建了一个SpringBoot的示例项目,以了解外部客户机功能,运行时会出现以下错误。 com.example.demo.RestClient中的字段Remote teCallClient需要一个类型为com.example.demo.Remote teCallClient的bean,但找不到。操作:考虑在配置中定义类型为com.example.demo.远程呼叫客户端的bean。 我尝试了各种

  • 我无法在intellij中运行Spring Boot Framework应用程序。我正在使用maven,由于某种原因,它找不到我的主类。另外,在我的Spring应用程序类中,我得到了SpringApplication的一个错误。运行表示无法访问组织的命令。springframework。果心环境。环保。 我的pom.xml: 这是我的课程: }

  • 当我试图将一个项目翻译成Spring Boot时,我遇到了一个错误——我无法理解我做错了什么。将后缀和前缀添加到属性文件中,试图更改jsp的位置,debager显示在控制器的方法中。我做错了什么?如果有任何帮助,我将不胜感激 错误: 此应用程序没有针对/错误的显式映射,因此您将其视为回退。 2018年7月17日星期二00:45:23出现意外错误(类型=未找到,状态=404)/批准jsp Sprin

  • 问题内容: 我正在编写一个使用node.js访问本地文件系统的桌面Web应用程序。我目前可以使用node.js打开文件并将其复制到硬盘驱动器上的不同位置。我还想做的是允许用户使用与文件类型关联的应用程序打开特定文件。换句话说,如果用户在Windows环境中选择“ myfile.doc”,它将使用该文件启动MSWord。 我一定是术语的受害者,因为除了与node.js进行通信的子进程的生成之外,我什