springboot+duboo Initialization of bean failed; nested exception is java.lang.IllegalStateException

问题描述:

在dubbo中,启动springboot,启动出错。出错描述为:

Initialization of bean failed; nested exception is java.lang.IllegalStateException

具体描述为:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Failed to create adaptive instance: java.lang.IllegalStateException: Can't create adaptive extension interface org.apache.dubbo.common.extension.ExtensionFactory, cause: Extension instance (name: adaptive, class: interface org.apache.dubbo.common.extension.ExtensionFactory) couldn't be instantiated: Could not initialize class com.alibaba.dubbo.common.logger.LoggerFactory

看了各种类型的文章之后,有很多种解释,我都试过解决不成功。

问题分析:
最后我发现:出错的原因是在serviceImpl层中的注解有问题。

由于maven仓库中我们添加dubbo的springboot依赖为

<!--添加dubbo的springboot依赖-->
        <!-- https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-spring-boot-starter -->
        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <version>2.7.8</version>
        </dependency>

之后我们会在serviceImpl层中通过导入dubbo的@Service注解

import org.apache.dubbo.config.annotation.Service;
//声明这是一个dubbo服务
@Service(version = "1.0.0")

我们会发现@Service被划掉。

@Servise被划掉
最后我们就会报上述的错误。

解决方案:

在这里插入图片描述

<!--添加dubbo的springboot依赖-->
<!-- https://mvnrepository.com/artifact/org.apache.dubbo/dubbo-spring-boot-starter -->
<dependency>
    <groupId>org.apache.dubbo</groupId>
    <artifactId>dubbo-spring-boot-starter</artifactId>
    <version></
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值