简体   繁体   中英

ClassNotFoundException: org.apache.flink.streaming.connectors.rabbitmq.common.RMQConnectionConfig$Builder

I am using flink 1.9.0 and rabbitmq connector to read the data, I can compile my code successfully, but when I run the code I get following error:

java.lang.NoClassDefFoundError: org/apache/flink/streaming/connectors/rabbitmq/common/RMQConnectionConfig$Builder

I don't have any scope defined in my pom file for dependencies.

final RMQConnectionConfig connectionConfig = new RMQConnectionConfig.Builder().setHost("myhost.com").setPort(1234).setUserName("username").setPassword("password").setVirtualHost("/").build();

I am trying to run the flink server locally, so first I start the flink cluster and then run following command.

./bin/flink run -c com.mycompany.App ~/.m2/repository/com/mycompany/flinker/1.0-SNAPSHOT/flinker-1.0-SNAPSHOT.jar

It sounds like the Flink runtime isn't finding flink-connector-rabbitmq_2.11-1.9.0.jar. You need to either package your code and any dependencies (including this one) into an uber jar, or copy the flink/rabbitmq jar into the lib directory of all of the machines in the cluster.

Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM