Pivotal Knowledge Base


External Table Query via GPHDFS Error: "Unsupported major.minor Version 51.0"


 Product  Version
 Pivotal Greenplum   4.3.x
 OS   RHEL 6.x
 Others  HDP 2.4


When querying one external table via GPHDFS protocol, it fails with error message “Unsupported major.minor version 51.0”.

Error Message:

gpadmin=# select * from employee_hdfs;
ERROR: external table gphdfs protocol command ended with error. Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/mapreduce/TaskAttemptContext : Unsupported major.minor version 51.0 (seg1 slice1 gpdb-sandbox.localdomain:40001 pid=23230)
DETAIL: at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.n
Command: 'gphdfs://hdp24a/tmp/emp.txt'
External table employee_hdfs, file gphdfs://hdp24a/tmp/emp.txt


The runtime JAVA version is not compatible with Hadoop JAR packages which are built with JDK7 (version 51.0).


Though the running JAVA environment has been configured to compatible version (JDK8) in ~gpadmin/.bashrc followed by restarting the Greenplum cluster, the issue still exists.

[gpadmin@gpdb-sandbox ~]$ grep JAVA_HOME .bashrc
export JAVA_HOME=/usr/java/default
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/amd64/server:$LD_LIBRARY_PATH
[gpadmin@gpdb-sandbox ~]$ ls -l /usr/java/default
lrwxrwxrwx 1 root root 17 Dec 8 22:08 /usr/java/default -> /usr/jdk1.8.0_60/ [gpadmin@gpdb-sandbox greenplum-db]$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

With further check, it's found that JAVA_HOME is set back to JRE6 in greenplum_path.sh which caused this issue.

[gpadmin@gpdb-sandbox greenplum-db]$ grep JAVA_HOME greenplum_path.sh
export JAVA_HOME


Remove JAVA settings in greenplum_path.sh to let the Greenplum system use default configuration in ~gpadmin/.bashrc.

Additional Information



Powered by Zendesk