解决java.lang.NoClassDefFoundError

报错信息如下:

[ERROR]Activator initialize error : websocket
[ERROR]io/netty/util/concurrent/GenericFutureListener
java.lang.NoClassDefFoundError: io/netty/util/concurrent/GenericFutureListener
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    ……
Caused by: java.lang.ClassNotFoundException: io.netty.util.concurrent.GenericFutureListener
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1363)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1186)
    ... 45 more

类找不到,应该是缺少了依赖,这个类对应的依赖可以从中得到它

https://mvnrepository.com/art...

你可以加

<!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>5.0.0.Alpha2</version>
</dependency>

到pom文件或从站点下载jar并将其添加到类路径或lib文件夹

相关推荐