. So we have this problem :
Exception in thread “main” java.lang.NoClassDefFoundError: Org/apache/flink/metrics/MetricGroup
the at org. Apache. The flink. Streaming. API. Environment. StreamExecutionEnvironment. AddSource StreamExecutionEnvironment. Java: (1614)
the at Org. Apache. Flink, streaming API. Environment. StreamExecutionEnvironment. FromCollection (StreamExecutionEnvironment. Java: 975)
the at Org. Apache. Flink, streaming API. Environment. StreamExecutionEnvironment. FromCollection (StreamExecutionEnvironment. Java: 945)
at the Map. The main (Map) Java: 22)
under Caused by: java.lang.ClassNotFoundException: Org. Apache. Flink. Metrics. MetricGroup
the at java.net.URLClassLoader.findClass (URLClassLoader. Java: 381)
the at Java lang. This. The loadClass (424). This Java:
the at Sun. Misc. The Launcher $AppClassLoader. LoadClass (335). The Launcher Java:
the at Java lang. This. LoadClass (357). This Java:
… 4 more
obviously the first thing to do is go to $FLINK_HOME and type in
grep -r MetricGroup p>
returns
flink – dist_2. 11-1.12 – the SNAPSHOT. Jar p>
Flink-dist
is really no way, stuck for a long time, the last way is as follows :
import flink-dist-***.jar
directly in Project Structure under $FLINK_HOME/libthen run the code again, problem solved.
p>
Read More:
- org.apache.flink.runtime.client.JobSubmissionException: Failed to submit JobGraph
- Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibat
- How to Fix:java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/methods/HttpPost
- NoClassDefFoundError: org/codehaus/jackson/map/ObjectMapper
- Spring nested exception is java.lang.NoClassDefFoundError: org/springframework/core/MethodClassKey
- NoClassDefFoundError: org.springframework.validation.annotation.ValidationAnnotationUtils
- java.lang.NoClassDefFoundError: org/junit/platform/launcher/TestExecutionListener
- Flink 1.1 error: no executorfactory found to execute the application
- Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
- org.apache.jasper.JasperException: Unsupported encoding:
- Mistakes in learning Flink programming
- org.apache.catalina.LifecycleException: Protocol handler start failed
- tomcat Issues org.apache.catalina.LifecycleException: Failed to start component
- Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign
- org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].Standar
- [How to Fix] org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
- Run spark to report error while identifying ‘ org.apache.spark . sql.hive.HiveSessionState ‘
- Caused by: org.apache.catalina.LifecycleException: A child container failed during start
- org.apache.spark.SparkException: Task not serializable
- ImportError: cannot import name ‘calinski_harabaz_score‘ from ‘sklearn.metrics‘