12 Replies Latest reply on May 14, 2018 2:41 PM by srinath0533

    Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.

    srinath0533

      Hello All,

       

      I'm trying to connect my Jboss DV to Hive using Jboss Developer Studio.

       

      - Jboss Developer Version: 9.1.0.GA

      - Redhat Jboss EAP 6.1+

      - Teiid-engine-8.12.5.redhat-8

      - Hive Driver - hive-jdbc-0.12.0.2.0.6.0-76.jar  /  Hive-jdbc-2.1.0.2.6.3.19-2-standalone.jar  /  Hive Driver - hive-jdbc-2.0.0.jar

       

      I followed the below steps.

       

      1. I added hive-jdbc-2.0.0.jar in C:\EAP-6.4.0\docs\teiid\datasources\hive folder.

      2. Downloaded TeiidModule-Hive12.zip and copied it into lation in the C:\EAP-6.4.0\modules folder and unziped it.

      3. Edited the Standalone.xml file in standalone\configuration folder to add below under drivers section.

      <driver name="hive12" module="org.apache.hadoop.hive12">

                  <driver-class>org.apache.hive.jdbc.HiveDriver</driver-class>

             </driver>

       

      4. Started local teiid instance.

      5. Created HadoopDS project.

      6. File > Import... > Teiid Connection >> Source Model , then click Next

      7. On the 'Create DataSource' dialog:

      Enter HadoopDS for Name:

      In the Available Drivers list, select hive12 (we set this up in the standalone.xml previously)

      For the connection-url property, enter jdbc://******.******:******

      Gave username and password and details and Next.

       

      8. On the next page of the Teiid Connection import wizard

      Selected hive for the translator

      In the Optional Source Import Properties, added a property

      Name = trimColumnNames, value = true

      Enter HadoopSrcMdl for the target Model Name

      click Next

       

      9. Error deploying "importVDB". Please check the server log. This is the error i see. I have attached the server log. It says

       

      Wrong driver class

      Caused by: javax.resource.ResourceException: Wrong driver class [class org.apache.hive.jdbc.HiveDriver]

       

      Please help. Any suggestions will be much appreciated.

        • 1. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
          rareddy

          1) Looks like Hive now offer the single JAR like "hive-jdbc-2.1.0.2.6.3.19-2-standalone.jar" so, download whatever version that matches with your server.

          2) Copy this JAR into "modules/system/layers/dv/org/apache/hadoop/hive/main" directory.

          3) Create a module.xml file in "modules/system/layers/dv/org/apache/hadoop/hive/main" that looks like

           

          <?xml version="1.0" encoding="UTF-8"?>

           

          <module xmlns="urn:jboss:module:1.0" name="org.apache.hadoop.hive">

              <resources>

                <resource-root path="hive-jdbc-2.1.0.2.6.3.19-2-standalone.jar"/>

              </resources>

              <dependencies>

                  <module name="org.slf4j"/>

                  <module name="org.apache.commons.logging"/>

                  <module name="javax.api"/>

                  <module name="javax.resource.api"/>

              </dependencies>

          </module>

           

          Note adjust above to your version of the driver.

           

          4) Edit standalone.xml ( if using Teiid, then standalone-teiid.xml ) file add the following file contents under "datasources" subsystem from file "/docs/teiid/datasources/hive/hive2.xml". Note you have to provide the correct host, port and credential information to access your Hive server.

          5) Restart the server

          6) Now do the import process from Designer as you did above. But note the JNDI name from above step that you need to select in data sources section during the import.

           

           

          If you are using any older versions than upgrade to at least Teiid 9.3 or 10.2 versions, as there were many changes in the Hive translator.

          • 2. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
            srinath0533

            Hello Ramesh,

             

            I followed above steps and received the "Wrong Driver Class" as below.

             

            Caused by: javax.resource.ResourceException: Wrong driver class [class org.apache.hive.jdbc.HiveDriver] for this connection

             

            I tried with multiple driver class as below.

             

            org.apache.hadoop.hive.jdbc.HiveDriver

            org.apache.hive.jdbc.HiveDriver

             

            The driver im using is "hive-jdbc-2.1.0.2.6.3.19-2-standalone" which is added in ((C:\EAP-6.4.0\modules\system\layers\dv\org\apache\hadoop\hive\main))

             

            However i received same error. I'm having really hard time finding videos or content online. I followed steps as per the instructions and now ran out of options.

             

            Please help me connecting to Hive server. This is almost critical for me at this moment.

             

            I have attached the

            standalone.xml (C:\EAP-6.4.0\standalone\configuration),

            module.xml (C:\EAP-6.4.0\modules\system\layers\dv\org\apache\hadoop\hive\main)

            Hive2.xml (C:\EAP-6.4.0\docs\teiid\datasources\hive)

            • 3. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
              rareddy

              Attach your standalone.xml file and module.xml file.

              • 4. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                srinath0533

                I did attached files in the previous message.

                • 5. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                  rareddy

                  From the server.log from original message, it looks like you added the hive-jdbc-0.12.0.2.0.6.0-76.jar to "deployments" directory. It should not be there. It needs to be in same directory as the module.xml file. And you do not need

                   

                  hive-exec-0.12.0.2.0.6.0-76.jar

                  hive-service-0.12.0.2.0.6.0-76.jar

                  hive-jdbc-2.0.0.jar

                   

                  10:17:11,350 INFO  [org.jboss.as.repository] (management-handler-thread - 8) JBAS014900: Content added at location C:\EAP-6.4.0\standalone\data\content\07\a3a5eb310e070a5d582e02cc6dada4e289ceea\content
                  10:17:11,350 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "hive-jdbc-0.12.0.2.0.6.0-76.jar" (runtime-name: "hive-jdbc-0.12.0.2.0.6.0-76.jar")
                  10:17:11,486 INFO  [org.jboss.as.server] (management-handler-thread - 8) JBAS015859: Deployed "hive-jdbc-0.12.0.2.0.6.0-76.jar" (runtime-name : "hive-jdbc-0.12.0.2.0.6.0-76.jar")
                  10:23:50,251 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment hive-jdbc-0.12.0.2.0.6.0-76.jar (runtime-name: hive-jdbc-0.12.0.2.0.6.0-76.jar) in 28ms
                  10:23:50,251 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "hive-jdbc-0.12.0.2.0.6.0-76.jar" (runtime-name: "hive-jdbc-0.12.0.2.0.6.0-76.jar")
                  10:23:50,335 INFO  [org.jboss.as.server] (management-handler-thread - 12) JBAS015865: Replaced deployment "hive-jdbc-0.12.0.2.0.6.0-76.jar" with deployment "hive-jdbc-0.12.0.2.0.6.0-76.jar"
                  10:24:09,070 INFO  [org.jboss.as.repository] (management-handler-thread - 11) JBAS014900: Content added at location C:\EAP-6.4.0\standalone\data\content\05\c6c3aab623f8805f9086b33e045697a0907cb8\content
                  10:24:09,070 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "hive-exec-0.12.0.2.0.6.0-76.jar" (runtime-name: "hive-exec-0.12.0.2.0.6.0-76.jar")
                  10:24:09,727 INFO  [org.jboss.as.server] (management-handler-thread - 11) JBAS015859: Deployed "hive-exec-0.12.0.2.0.6.0-76.jar" (runtime-name : "hive-exec-0.12.0.2.0.6.0-76.jar")
                  10:24:21,695 INFO  [org.jboss.as.repository] (management-handler-thread - 9) JBAS014900: Content added at location C:\EAP-6.4.0\standalone\data\content\82\aa808441587894d25289ca0a0ee933c67d9640\content
                  10:24:21,695 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "hive-service-0.12.0.2.0.6.0-76.jar" (runtime-name: "hive-service-0.12.0.2.0.6.0-76.jar")
                  10:24:21,894 INFO  [org.jboss.as.server] (management-handler-thread - 9) JBAS015859: Deployed "hive-service-0.12.0.2.0.6.0-76.jar" (runtime-name : "hive-service-0.12.0.2.0.6.0-76.jar")
                  10:24:40,472 INFO  [org.jboss.as.repository] (management-handler-thread - 10) JBAS014900: Content added at location C:\EAP-6.4.0\standalone\data\content\ad\6a9a8a61a882faaad3c5a36ebf794a073dd344\content
                  10:24:40,472 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "hive-jdbc-2.0.0.jar" (runtime-name: "hive-jdbc-2.0.0.jar")
                  10:24:40,495 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class org.apache.hive.jdbc.HiveDriver (version -1.-1)
                  10:24:40,527 INFO  [org.jboss.as.server] (management-handler-thread - 10) JBAS015859: Deployed "hive-jdbc-2.0.0.jar" (runtime-name : "hive-jdbc-2.0.0.jar")

                   

                  Remove those files. If this just a development server, you can just remove "standalone/data" directory, but note all your deployments will be gone. Otherwise do

                   

                  ./jboss-cli.sh --connect

                  undeploy hive-jdbc-0.12.0.2.0.6.0-76.jar

                  undeploy hive-exec-0.12.0.2.0.6.0-76.jar

                  undeploy hive-service-0.12.0.2.0.6.0-76.jar

                  undeploy hive-jdbc-2.0.0.jar

                   

                  then remove all above files from "standalone/deployments" directory *if* they exist there. Then make sure your  hive-jdbc-0.12.0.2.0.6.0-76.jar in same directory as module.xml and restart server. If you still have an error attach the error log.

                  • 6. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                    srinath0533

                    Hello Ramesh,

                     

                    Thank you for your quick response and support. I was able to connect to Hive using JDBC Connection profile.  I was not able to connect using Teiid Importer.  Below are the steps to connect to Hive using Generic JDBC Connection Profile.

                     


                    1. Select "Create JDBC Connection"

                    2. Then choose "Generic JDBC" from the list of connection profiles.

                    3. Select" New Driver Definition" option beside the Drivers drop down option. Circled below in BLUE

                    4. Select "Generic JDBC Driver" under "Name/Type" tab

                    5. Add below jar files in "Jar List" tab. NOTE:  Please use the Hive Jar versions based on the Jboss version you have. I tried with different jar files and did not work. So version should match your Jboss.

                     

                    6. Provide connection details in "Properties" tab as below.

                     

                    7. Click "OK" and enter the "Password". Please TEST the connection and once successful  click "Next" and click "Finish".

                     

                    Now the JDBC connection profile is created.

                     

                    8. Then click on "Create Source Model for JDBC data source" as shown below and click "Next" on "Import Database via JDBC" tab.

                    9. Select the options what you need. Ex: Table, View, Index_table on "Select Database Metadata" tab and click "NEXT"

                     

                     

                    10. Select the required schemas, tables/views on "Select Database Objects" tab and Click next.

                    11. Select the "Into Folder" under Specify Import Options window where you want to create the tables/views and click Finish.

                     

                    Tables, Views will be created under the folder you mentioned in the above step.

                    • 7. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                      rareddy

                      After following the instructions given before to create Hive source connection in JDV, you need to use "Teiid Connection Importer" in the Designer to connect and build your model. Be sure to select "hive" as translator.

                      • 8. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                        srinath0533

                        Hello Ramesh,

                         

                        Thank you for the suggestion and sorry for the delayed response.  As you mentioned after creating the JDBC Source connection i tried to create connection using TEIID Importer but i still see the same issue "Error deploying "importVDB". Please check the server log. And when i see server log in C:\EAP-6.4.0\standalone\log its not updated.

                         

                        My question is what is the difference between connecting to Hive through Generic JDBC Connection and TEIID Importer??  What are the limitations using Generic JDBC Connection instead of TEIID Importer?

                         

                        Thank you for quick responses Ramesh. I really appreciate it.

                         

                        Thanks,

                        Srinath

                        • 9. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                          rareddy

                          "Generic JDBC Connection" makes JDBC connection from Designer directly to the Hive and downloads the metadata. Whereas "Teiid Connection Importer" uses the connection in server and server facilities to download the metadata.

                           

                          I am not sure what kind of error you are running into without much more details, so, for now, I leave this as user error.

                          • 10. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                            srinath0533

                            Hive Issue is resolved. Thank you Ramesh.

                            • 11. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                              rareddy

                              What is the action you took to solve this?

                              • 12. Re: Issues connecting Jboss DV to Hive source.  Wrong Driver Class is the error.
                                srinath0533

                                The jar files what i tried were incorrect. The DevStudio and Teiid Designer(im not sure if this also a cause) what i have was also order version.  Later i used the below jar files and i have upgraded to DevStudio 11.3.0.  i was able to connect through JDBC Connection and Teiid Importer as well. So after making these 2 changes i was able to connect in both ways and import the metadata.