我是靠谱客的博主 帅气小鸭子,最近开发中收集的这篇文章主要介绍Dubbo 启动 报 javassist/ClassPath And org/jboss/netty/channel/ChannelFactory异常,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

一. javassist/ClassPath

在使用Dubbo的时候,启动报错如下:

aused by: java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/F:/My_WorkSpace/repository/com/alibaba/dubbo/2.5.3/dubbo-2.5.3.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath
    at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:685)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.loadExtensionClasses(ExtensionLoader.java:591)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.getExtensionClasses(ExtensionLoader.java:567)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:728)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:455)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:738)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:732)
    at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721)
    ... 27 more
Caused by: java.lang.NoClassDefFoundError: javassist/ClassPath

解决,缺失jar:

<!--javassist jar-->
<dependency>
    <groupId>org.javassist</groupId>
    <artifactId>javassist</artifactId>
    <version>${you_version}</version>
</dependency>

二. org/jboss/netty/channel/ChannelFactory

Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
    at com.alibaba.dubbo.remoting.transport.netty.NettyTransporter.bind(NettyTransporter.java:33)
    at com.alibaba.dubbo.remoting.Transporter$Adpative.bind(Transporter$Adpative.java)
    at com.alibaba.dubbo.remoting.Transporters.bind(Transporters.java:48)
    at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchanger.bind(HeaderExchanger.java:41)
    at com.alibaba.dubbo.remoting.exchange.Exchangers.bind(Exchangers.java:63)
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.createServer(DubboProtocol.java:287)
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.openServer(DubboProtocol.java:266)
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol.export(DubboProtocol.java:253)
    at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:56)
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:55)
    at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java)
    at com.alibaba.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:153)
    at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:107)
    at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:54)
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:53)
    at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java)
    at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:485)
    at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:281)
    at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:242)
    at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:143)
    at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:109)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at com.dufy.service.ProviderServiceTest.main(ProviderServiceTest.java:21)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.ChannelFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

解决,Dubbo依赖Netty,添加jar:

<!--netty jar-->
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty</artifactId>
    <version>${you_version}</version>
</dependency>

上述中的, ${you_version}表示的是你自己对应的jar 版本


三、参考地址

https://blog.csdn.net/u010648555/article/details/78015518

最后

以上就是帅气小鸭子为你收集整理的Dubbo 启动 报 javassist/ClassPath And org/jboss/netty/channel/ChannelFactory异常的全部内容,希望文章能够帮你解决Dubbo 启动 报 javassist/ClassPath And org/jboss/netty/channel/ChannelFactory异常所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部