我正在尝试创建一个cep程序,该程序能够检测用户的工资何时发生变化。所以我编写了这段代码
Pattern
.<comptedata>begin("First Event").subtype(comptedata.class).where(
new SimpleCondition<comptedata>() {
@Override
public boolean filter(comptedata event) throws Exception {
if (event.getoperation()!="virement"){
return false ;
}
return event.getMontantop() != event.getsalaire();
}
})
.followedBy("seconf Event").subtype(comptedata.class).where(
new SimpleCondition<comptedata>() {
@Override
public boolean filter(comptedata event) throws Exception {
if (event.getoperation()!="virement"){
return false ;
}
return event.getMontantop() != event.getsalaire();
}
});
但是它给了我这个错误
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flink/api/common/ExecutionConfig$ClosureCleanerLevel
at org.apache.flink.cep.pattern.Pattern.where(Pattern.java:159)
at myflink.cep.changePattern.getEventPattern(changePattern.java:19)
at myflink.app.toWarningStream(app.java:69)
at myflink.app.main(app.java:52)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.api.common.ExecutionConfig$ClosureCleanerLevel
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
从这个问题(Why am I getting a NoClassDefFoundError in Java?)我了解到,有一个我的代码所依赖的类文件,该文件在编译时存在,但在运行时找不到,但是我的项目构造函数i中已经存在flink-core试图在运行时进行编译而不是编译,但是它不能解决我不知道该怎么办的问题