Reply
Highlighted
Explorer
Posts: 6
Registered: ‎07-20-2017

Error while using MetaDataExtractor API from Cloudera Navigator SDK

[ Edited ]

Hi,

 

I am trying to use the Cloudera Navigator MetaDataExtractor class to search a particilar table and retrieve the entity id of it. 

When I am trying to run the program, I am getting a noclassdeferror for com/cloudera/com/fasterxml/jackson/core/type/TypeReference.

 

I am not sure which jar addresses the dependency for this error. I have pasted the error, code and pom.xml below. Any help regarding this is appreciated.

 

 

Exception in thread "main" java.lang.NoClassDefFoundError: com/cloudera/com/fasterxml/jackson/core/type/TypeReference
	at com.gfk.util.client.cloudera.ClouderaNavigatorClient.main(ClouderaNavigatorClient.java:16)
Caused by: java.lang.ClassNotFoundException: com.cloudera.com.fasterxml.jackson.core.type.TypeReference
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 1 more

 

This is my code.

 

 

package com.util.client.cloudera;

import java.util.Map;

import com.cloudera.nav.sdk.client.MetadataExtractor;
import com.cloudera.nav.sdk.client.NavApiCient;
import com.cloudera.nav.sdk.client.NavigatorPlugin;
import com.cloudera.nav.sdk.model.Source;
import com.cloudera.nav.sdk.model.SourceType;

public class ClouderaNavigatorClient {

	public static void main(String[] args) {
		NavigatorPlugin plugin = NavigatorPlugin.fromConfigFile("F:/navigator.conf");
		NavApiCient client = plugin.getClient();
		MetadataExtractor extractor = new MetadataExtractor(client, null);
		Iterable<Map<String, Object>> entity = extractor.extractMetadata(null,
		        null, "originalName:mytable1", null).getEntities();
		
		System.out.println("ClouderaNavigatorClient.main(): OUT : " + hive.getClusterName());   
		

	}

}

 

And this is my pom.xml

 

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.some.util</groupId>
  <artifactId>someid</artifactId>
  <version>0.0.1</version> 
  
   <properties>
   <cdh5.version>cdh5.4.0</cdh5.version>
  	<cdh5.hadoop.version>2.7.3</cdh5.hadoop.version>
    <joda.version>2.1</joda.version>
	<cloudera.navigator.version>1.0</cloudera.navigator.version>  
    <spring.version>4.0.7.RELEASE</spring.version>
    <guava.version>14.0.1</guava.version>
    <cxf.version>2.7.5</cxf.version>
    <httpcomponents.version>4.2.5</httpcomponents.version>
    <jackson2.version>2.1.0</jackson2.version>
    <surefire.version>2.16</surefire.version>
    <minJavaVersion>1.7</minJavaVersion>
    <maxJavaVersion>1.8</maxJavaVersion>
    <minSupportedJvmVersion>1.7</minSupportedJvmVersion>
    <log4j.version>1.2.16</log4j.version>
    <avro.version>1.7.4</avro.version>
    <cdh5.version>cdh5.4.0</cdh5.version>
    <cdh5.hadoop.version>2.6.0-${cdh5.version}</cdh5.hadoop.version>
       
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>com.cloudera.navigator</groupId>
      <artifactId>navigator-sdk-model</artifactId>
      <version>${cloudera.navigator.version}</version>
    </dependency>
    <dependency>
      <groupId>com.cloudera.navigator</groupId>
      <artifactId>navigator-sdk-client</artifactId>
      <version>${cloudera.navigator.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-configuration</groupId>
      <artifactId>commons-configuration</artifactId>
      <version>1.9</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>${joda.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
      <version>${avro.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpcomponents.version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-joda</artifactId>
        <version>${jackson2.version}</version>
      </dependency>
       <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
      </dependency>
    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-client</artifactId>
        <version>2.6.0-cdh5.4.0</version>
      </dependency>
      <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>2.6.0-cdh5.4.0</version>
                <scope>compile</scope>
            </dependency>
  </dependencies>  
  
  <build>
        <plugins>            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
            </plugin>
        </plugins>
    </build>
</project>

 

 

Announcements
New solutions