使用datart连接hive报org.apache.thrift.transport.TTransport

网友投稿 311 2022-11-21

使用datart连接hive报org.apache.thrift.transport.TTransport

报错Caused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransport

2022-02-28 18:55:08.017 ERROR datart.server.config.WebExceptionHandler : Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransportorg.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransport at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1075) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:962) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at javax.servlet. at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) at org.apache.coyote. at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.NoClassDefFoundError: org/apache/thrift/transport/TTransport at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at datart.data.provider.jdbc.adapters.JdbcDataProviderAdapter.test(JdbcDataProviderAdapter.java:99) at datart.data.provider.JdbcDataProvider.test(JdbcDataProvider.java:66) at datart.data.provider.ProviderManager.testConnection(ProviderManager.java:82) at datart.server.service.impl.DataProviderServiceImpl.testConnection(DataProviderServiceImpl.java:118) at datart.server.controller.DataProviderController.testConnection(DataProviderController.java:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1060) ... 39 common frames omittedCaused by: java.lang.ClassNotFoundException: org.apache.thrift.transport.TTransport at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 58 common frames omitted

报错原因是因为我只加了hive-jdbc的包,无所加载到其他的类

解决方案:

cd /opt/cloudera/parcels/CDH-6.3.0-1.cdh6.3.0.p0.1279813/jarscp hive-common-2.1.1-cdh6.3.0.jar /opt/datart/lib/cp hive-service-2.1.1-cdh6.3.0.jar /opt/datart/lib/cp hive-serde-2.1.1-cdh6.3.0.jar /opt/datart/lib/cp hive-metastore-2.1.1-cdh6.3.0.jar /opt/datart/lib/cp hive-shims-* /opt/datart/lib/cp hive-exec-2.1.1-cdh6.3.0.jar /opt/datart/lib/cd /opt/datart/binsh datart-server.sh restarthive的jdbc开发环境依赖的jar包hive-common-2.1.1-cdh6.3.0.jarhive-exec-2.1.1-cdh6.3.0.jarhive-jdbc-2.1.1-cdh6.3.0.jarhive-metastore-2.1.1-cdh6.3.0.jarhive-serde-2.1.1-cdh6.3.0.jarhive-service-2.1.1-cdh6.3.0.jarhive-shims-0.23-2.1.1-cdh6.3.0.jarhive-shims-2.1.1-cdh6.3.0.jarhive-shims-common-2.1.1-cdh6.3.0.jarhive-shims-scheduler-2.1.1-cdh6.3.0.jar

重新配置

hive的配置如下:

jdbc:hive2://192.168.16.108:10000驱动类填写org.apache.hive.jdbc.HiveDriver

测试连接成功

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:讲一下 Hbase 架构#yyds干货盘点#
下一篇:74LS373在单片机接口的设计应用
相关文章

 发表评论

暂时没有评论,来抢沙发吧~