سؤال

I am attempting to use the Impala JDBC driver when creating a new Universe. When I test the connection I am receiving the following error:

CS: Java Exception : java.lang.UnsupportedClassVersionError: Bad version number in .class file

I have modified the sbo file as follows:

<DataBase Active="Yes" Name="Generic JDBC datasource">
  <JDBCDriver>
    <!--  Uncomment and edit the following lines
                 to define java classes required by JDBC driver
            &lt;ClassPath&gt;
                &lt;Path&gt;your jar or class files directory&lt;/Path&gt;
            &lt;/ClassPath&gt;
             -->
    <ClassPath><Path>C:\impala-jdbc-0.5-2\hive-jdbc-0.10.0-cdh4.2.0.jar</Path></ClassPath>
    <Parameter Name="JDBC Class">org.apache.hive.jdbc.HiveDriver</Parameter>
    <Parameter Name="URL Format">jdbc:hive2://$DATASOURCE$/;auth=noSasl</Parameter>
  </JDBCDriver>
  <Parameter Name="Family">Generic</Parameter>
  <Parameter Name="SQL External File">jdbc</Parameter>
  <Parameter Name="SQL Parameter File">jdbc</Parameter>
  <Parameter Name="Description File">generic_jdbc</Parameter>
  <Parameter Name="Driver Capabilities">Query</Parameter>
  <Parameter Name="Transactional Available">No</Parameter>
  <Parameter Name="Max Rows Available">No</Parameter>
  <Parameter Name="Query TimeOut Available">No</Parameter>
  <Parameter Name="Array Fetch Size">10</Parameter>
</DataBase>
هل كانت مفيدة؟

المحلول

The error message sounds like the class being used in the driver was compiled with a newer version of java than you are currently executing under (example, running Java 5, but driver was compiled with Java 6). Since you are creating the Universe, the version difference is most likely local to your machine.

To resolve this you have 2 options:

  1. Upgrade the version of Java to at least the version used to compile the driver
  2. Use a previous version of the JDBC driver to match the version of java you are executing as.
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top