无法执行由ClassNotFoundException引起的Flink仪表板版本1.3.2中的CEP模式 [英] Unable to execute CEP pattern in Flink dashboard version 1.3.2 which is caused by ClassNotFoundException

查看:329
本文介绍了无法执行由ClassNotFoundException引起的Flink仪表板版本1.3.2中的CEP模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了一个像这样的简单模式

I have written a simple pattern like this

   Pattern<JoinedEvent, ?> pattern = Pattern.<JoinedEvent>begin("start")
            .where(new SimpleCondition<JoinedEvent>() {
     @Override
     public boolean filter(JoinedEvent streamEvent) throws Exception {

            return streamEvent.getRRInterval()>= 10 ;
                        }
             }).within(Time.milliseconds(WindowLength));

,它在IntellijIdea中执行良好.我在仪表板和IntelliJ-Idea中都使用了Flink 1.3.2.当我从源代码构建Flink时,我看到了很多警告消息,使我相信迭代条件类未包含在jar中,因为错误也表示ClassNotFoundException.以下是错误

and it executes well in IntellijIdea. I am using Flink 1.3.2 both in the dashboard and in IntelliJ-Idea. While I was building Flink from source, I have seen a lot of warning messages which led me to believe that iterative condition classes have not been included in a jar as error also says ClassNotFoundException. Below is the error

Caused by: java.lang.NoClassDefFoundError: org/apache/flink/cep/pattern/conditions/IterativeCondition
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at 

org.apache.flink.client.program.PackagedProgram.hasMainMethod(PackagedProgram.java:492)
    ... 38 more
Caused by: java.lang.ClassNotFoundException: org.apache.flink.cep.pattern.conditions.IterativeCondition
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 44 more

推荐答案

经过一整天的努力,我们终于找到了解决方案.问题是非常基本的,这是Flink CEP不属于二进制发行版的一部分,因此,每当我尝试执行模式时,都会给我一个错误.

After a whole day of my effort to solve this problem, finally, I got the solution. The problem was pretty basic, which is that Flink CEP is not a part of the binary distribution, so whenever I tried to execute pattern it gave me an error.

解决方案很简单

如您所见,Flink Binary没有cep jar.

As you can see Flink Binary does not have the cep jar.

所以请转到您的IDE(在我的情况下为IntelliJ)并复制所需的jar

so go to your IDE which is IntelliJ in my case and copy the required jar

转到此位置,然后将此jar复制并粘贴到您的二进制版本的lib文件夹中.

Go to this location and copy paste this jar to lib folder in your binary version.

Yalaa,问题已解决

Yalaa, problem solved

这篇关于无法执行由ClassNotFoundException引起的Flink仪表板版本1.3.2中的CEP模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆