不多说,直接上干货!
问题详情
[hadoop@bigdatamaster oozie-4.1.-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection
[hadoop@bigdatamaster oozie-4.1.-cdh5.5.4]$ bin/ooziedb.sh create -sqlfile oozie.sql -run DB Connection
setting CATALINA_OPTS="$CATALINA_OPTS -Xmx1024m" Validate DB Connection
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/mysql/jdbc/Driver : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:)
at java.net.URLClassLoader.access$(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:)
at org.apache.oozie.tools.OozieDBCLI.createConnection(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.validateConnection(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:)
at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:)
解决办法
原因:
1、jdk7+老版5.0驱动com/mysql/jdbc/Driver (同时,多试试几个版本。mysql-connector-java-5.1.31-bin.jar 和 mysql-connector-java-5.1.21-bin.jar )
2、jdk8+新版6.0驱动com/mysql/cj/jdbc/Driver
对于这样的mysql驱动包,怎么去下载,建议去http://mvnrepository.com/。当然你也可以去CSDN资源里去。这里不多赘述
mysql-connector-java-5.1..jar
即可。
成功!
然后呢,大家也许还会出现如下问题: