本文主要是介绍flume中调用自定义解析器报错:Unhandled error java.lang.UnsupportedClassVersionError:...Unsupported major.minor v,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、环境
CDH5.15.2
Jdk1.7
二、问题描述
将flume自定义ETL和分类器上传到集群,然后启动flume服务,结果报错:
2020-03-16 03:07:53,094 ERROR org.apache.flume.node.PollingPropertiesFileConfigurationProvider: Unhandled error
java.lang.UnsupportedClassVersionError: com/bd/flume/interceptor/LogETLInterceptor : Unsupported major.minor version 52.0at java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClass(ClassLoader.java:800)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)at java.net.URLClassLoader.access$100(URLClassLoader.java:71)at java.net.URLClassLoader$1.run(URLClassLoader.java:361)at java.net.URLClassLoader$1.run(URLClassLoader.java:355)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:354)at java.lang.ClassLoader.loadClass(ClassLoader.java:425)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)at java.lang.ClassLoader.loadClass(ClassLoader.java:358)at java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:190)at org.apache.flume.interceptor.InterceptorBuilderFactory.newInstance(InterceptorBuilderFactory.java:48)at org.apache.flume.channel.ChannelProcessor.configureInterceptors(ChannelProcessor.java:111)at org.apache.flume.channel.ChannelProcessor.configure(ChannelProcessor.java:82)at org.apache.flume.conf.Configurables.configure(Configurables.java:41)at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:348)at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:101)at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:145)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)at java.lang.Thread.run(Thread.java:745)
三、问题原因
核心关键报错是Unsupported major.minor version 52.0。经过查询,了解是jdk版本不支持的原因,version 52.0即jdk1.8的意思。因为flume解析器是jdk1.8编译的,而CDH集群是使用jdk1.7,所以导致无法调用。
四、解决办法
替换cdh的jdk为jdk1.8,具体操作参考文章:
https://blog.csdn.net/u010886217/article/details/104884639
五、参考
1.https://www.cnblogs.com/saule/p/11358085.html
2.https://blog.csdn.net/weixin_34166847/article/details/91782909
这篇关于flume中调用自定义解析器报错:Unhandled error java.lang.UnsupportedClassVersionError:...Unsupported major.minor v的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!