복붙노트

[HADOOP] java.lang.ClassNotFoundException가 : org.apache.hive.service.cli.HiveSQLException

HADOOP

java.lang.ClassNotFoundException가 : org.apache.hive.service.cli.HiveSQLException

스프링 애플리케이션을 통해 접속하기위한 하이브 난의 pom.xml에 의존성 이하 첨가 하였다.

<dependency>
 <groupId>org.apache.hive</groupId>
 <artifactId>hive-jdbc</artifactId>
 <version>2.1.1</version>
</dependency>
<dependency>
  <groupId>org.apache.thrift</groupId>
  <artifactId>libfb303</artifactId>
  <version>0.9.3</version>
    <exclusions>
     <exclusion>
    <groupId>org.apache.hive</groupId>
        <artifactId>hive-common</artifactId>
     </exclusion>
    </exclusions>
</dependency>
<dependency>
  <groupId>org.apache.hive</groupId>
  <artifactId>hive-service-rpc</artifactId>
  <version>2.1.1</version>
</dependency>

어떤 단지 내가 없거나 무엇 issue.Using 내가 직선을 통해 연결할 수 있어요 동일한 URL입니다하고있는 경우 한 말씀 해주십시오

 $HIVE_HOME/bin/beeline -u jdbc:hive2://localhost:10000/TEST_DB

나는 URL을 아래 참조해야하지만 아무 대답이 없습니다

org.apache.hive.service.cli.HiveSQLException : java.lang.NoClassDefFoundError가 : 조직 / 아파치 / 하둡 / IPC / CallerContext $ 빌더

해결법

  1. ==============================

    1.난 당신이 하이브 service.jar을 필요가 있다고 생각합니다. 이를 추가하고 작동하는지 확인합니다.

    난 당신이 하이브 service.jar을 필요가 있다고 생각합니다. 이를 추가하고 작동하는지 확인합니다.

  2. ==============================

    2.나는 우리가 단지와의 호환성 문제로 인해 가지고 질문 몇 가지 버전 즉이있는 예외의 봄 application.This 유형을 통해 하이브를 연결 마침내 수는 좀 더 명확하게 내 pom.xml 파일을 첨부하고 spring.Below 사용에 호환되지 않습니다.

    나는 우리가 단지와의 호환성 문제로 인해 가지고 질문 몇 가지 버전 즉이있는 예외의 봄 application.This 유형을 통해 하이브를 연결 마침내 수는 좀 더 명확하게 내 pom.xml 파일을 첨부하고 spring.Below 사용에 호환되지 않습니다.

    <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>
    
        <artifactId>spring-hadoop-samples-hive</artifactId>
    
        <name>Spring Hadoop Samples - Hive</name>
    
        <parent>
            <groupId>org.springframework.samples</groupId>
            <artifactId>spring-hadoop-samples</artifactId>
            <version>1.0.0.BUILD-SNAPSHOT</version>
            <relativePath>../parent/pom.xml</relativePath>
        </parent>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <spring.hadoop.version>2.3.0.M1</spring.hadoop.version>
            <hadoop.version>2.7.1</hadoop.version>
            <hive.version>1.2.1</hive.version>
            <!-- <hive.version>2.1.1</hive.version> -->
        </properties>
    
        <dependencies>
    
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-hadoop</artifactId>
                <version>${spring.hadoop.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-context-support</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>${hadoop.version}</version>
                <scope>compile</scope>
            </dependency>
    
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-metastore</artifactId>
                <version>${hive.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-service</artifactId>
                <version>${hive.version}</version>
            </dependency>
    
            <dependency>
                <groupId>org.apache.thrift</groupId>
                <artifactId>libfb303</artifactId>
                <version>0.9.1</version>
            </dependency>
    
            <!-- runtime Hive deps start -->
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-common</artifactId>
                <version>${hive.version}</version>
                <scope>runtime</scope>
            </dependency>
    
    
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-jdbc</artifactId>
                <version>${hive.version}</version>
                <scope>runtime</scope>
            </dependency>
    
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-shims</artifactId>
                <version>${hive.version}</version>
                <scope>runtime</scope>
            </dependency>
    
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-serde</artifactId>
                <version>${hive.version}</version>
                <scope>runtime</scope>
            </dependency>
    
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-contrib</artifactId>
                <version>${hive.version}</version>
                <scope>runtime</scope>
            </dependency>
    
            <!-- runtime Hive deps end -->
    
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>1.8.5</version>
                <scope>runtime</scope>
            </dependency>
    
        </dependencies>
    
        <repositories>
            <repository>
                <id>spring-milestone</id>
                <url>http://repo.spring.io/libs-milestone</url>
            </repository>
        </repositories>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>appassembler-maven-plugin</artifactId>
                    <version>1.2.2</version>
                    <configuration>
                        <repositoryLayout>flat</repositoryLayout>
                        <configurationSourceDirectory>src/main/config</configurationSourceDirectory>
                        <copyConfigurationDirectory>true</copyConfigurationDirectory>
                        <!-- Extra JVM arguments that will be included in the bin scripts -->
                        <extraJvmArguments>-Xms512m -Xmx1024m -Dhive.version=${hive.version}</extraJvmArguments>
                        <programs>
                            <program>
                                <mainClass>org.springframework.samples.hadoop.hive.HiveApp</mainClass>
                                <name>hiveApp</name>
                            </program>
                            <program>
                                <mainClass>org.springframework.samples.hadoop.hive.HiveClientApp</mainClass>
                                <name>hiveClientApp</name>
                            </program>
                            <program>
                                <mainClass>org.springframework.samples.hadoop.hive.HiveAppWithApacheLogs</mainClass>
                                <name>hiveAppWithApacheLogs</name>
                            </program>
                        </programs>
                    </configuration>
                    <executions>
                        <execution>
                            <id>package</id>
                            <goals>
                                <goal>assemble</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>config</id>
                            <phase>package</phase>
                            <configuration>
                                <tasks>
                                    <copy todir="target/appassembler/data">
                                        <fileset dir="data"/>
                                    </copy>
                                </tasks>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    
    </project>
    

    그것을 위해 명령 아래 실행 application.Please을 실행하는 동안 그 후에는 인증 문제를 발생할 수 있습니다.

    hadoop fs -mkdir /tmp
    hadoop fs -chmod a+w /tmp
    hadoop fs -mkdir -p /user/hive/warehouse
    hadoop fs -chmod a+w /user/hive/warehouse
    

    어떤 폴더 구조들이 없다면 그것은 생성하고 읽기를주고, 그 권한을 기록합니다.

  3. from https://stackoverflow.com/questions/44547186/java-lang-classnotfoundexception-org-apache-hive-service-cli-hivesqlexception by cc-by-sa and MIT license