Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caused by: java.lang.ClassNotFoundException: io.netty.channel.ChannelHandler #32

Closed
tx991020 opened this issue Mar 15, 2023 · 5 comments

Comments

@tx991020
Copy link

flink 1.14.5-2.12

Caused by: java.lang.NoClassDefFoundError: io/netty/channel/ChannelHandler
at org.apache.flink.streaming.connectors.redis.common.container.RedisCommandsContainerBuilder.build(RedisCommandsContainerBuilder.java:65)

how can i solve it?

@MingYu-Deng
Copy link

  1. Add to pom.xml
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <version>4.1.82.Final</version>
        </dependency>
  1. solution 1: use maven plugin (perfer maven-shade-plugin) to package this lib into you jar file.
  2. solution 2: copy all netty-* jar files into flink/libs directory , and restart you flink cluster.

@tx991020
Copy link
Author

image

image

image

我想以flink sql 运行,不想写java 代码,我该加些哪些lib 才能解决

@jeff-zou
Copy link
Owner

jeff-zou commented Mar 17, 2023

增加这两个包

 <dependency>
            <groupId>io.lettuce</groupId>
            <artifactId>lettuce-core</artifactId>
            <version>6.2.1.RELEASE</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/io.netty/netty-transport-native-epoll -->
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <version>4.1.82.Final</version>
        </dependency>

或者:
项目依赖Lettuce 6.2.1,如flink环境无lettuce,则使用mvn package -DskipTests打包生成的flink-connector-redis-1.2.6-jar-with-dependencies.jar

@jeff-zou jeff-zou reopened this Mar 17, 2023
@jeff-zou
Copy link
Owner

那你使用mvn package -DskipTests打包生成的flink-connector-redis-1.2.6-jar-with-dependencies.jar 吧。
一定可以的,Publisher就是lettuce包里的。

@tx910322
Copy link

mvn package -DskipTests great! , thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants