Caused by: java.lang.ClassNotFoundException: com.alibaba.dubbo.common.Version

<dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <version>0.2.1.RELEASE</version>
        </dependency>

Caused by: java.lang.ClassNotFoundException: com.alibaba.dubbo.common.Version

java.lang.NoClassDefFoundError: com/alibaba/dubbo/common/Version
at com.alibaba.boot.dubbo.context.event.WelcomeLogoApplicationListener.buildBannerText(WelcomeLogoApplicationListener.java:79) ~[dubbo-spring-boot-autoconfigure-0.2.1.RELEASE.jar:0.2.1.RELEASE]
at com.alibaba.boot.dubbo.context.event.WelcomeLogoApplicationListener.onApplicationEvent(WelcomeLogoApplicationListener.java:60) ~[dubbo-spring-boot-autoconfigure-0.2.1.RELEASE.jar:0.2.1.RELEASE]
at com.alibaba.boot.dubbo.context.event.WelcomeLogoApplicationListener.onApplicationEvent(WelcomeLogoApplicationListener.java:41) ~[dubbo-spring-boot-autoconfigure-0.2.1.RELEASE.jar:0.2.1.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:76) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at com.xxx.ticket.ProviderTicketApplication.main(ProviderTicketApplication.java:15) [classes/:na]
Caused by: java.lang.ClassNotFoundException: com.alibaba.dubbo.common.Version
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_112]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_112]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_112]
... 14 common frames omitted

报错并且dubbo-spring-boot-starter 0.2.1RELEASE 版本中没有 @Service //com.alibaba.dubbo.config.annotation 注解,将 版本换为 dubbo-spring-boot-starter 0.2.0,后启动项目正确;

<dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <!--<version>0.2.1.RELEASE</version>-->
            <version>0.2.0</version>
        </dependency>

相关推荐