springboot整合hive-jdbc遇到的坑
Posted hellodev
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springboot整合hive-jdbc遇到的坑相关的知识,希望对你有一定的参考价值。
问题描述:springboot整合hive-jdbc时,pom文件加入hive-client依赖,eclipse启动,项目正常启动,访问正常。打成jar包放到服务器启动正常,访问报错如下:
org.apache.jasper.JasperException: /views/public.jsp(3,62) PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:89) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:375) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:169) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:433) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:238) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:498) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:578) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1642) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parse(Parser.java:181) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:156) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:390) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:427) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:570) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1642) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.Parser.parse(Parser.java:181) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239) ~[jsp-2.1-6.1.14.jar!/:6.1.14]
原因分析:貌似是缺少jstl的jar包,检查后发现自己项目lib里有啊~~~,实际原因:jar包冲突。因为springboot内嵌tomcat,而hive-jdbc也有一堆附加依赖tomcat、jasper的jar(具体没看,大概瞅了一眼)。
解决:hive-jdbc依赖排除一切和自己想要的功能无关附加依赖,具体如下:
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>2.3.2</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-all</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hive</groupId>
<artifactId>hive-shims</artifactId>
</exclusion>
<exclusion>
<artifactId>jasper-compiler</artifactId>
<groupId>tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>jasper-runtime</artifactId>
<groupId>tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>servlet-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
<exclusion>
<artifactId>log4j-slf4j-impl</artifactId>
<groupId>org.apache.logging.log4j</groupId>
</exclusion>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<groupId>tomcat</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.orbit</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
OK,页面访问正常了~
————————————————
版权声明:本文为CSDN博主「-小末」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u013189824/article/details/80451095
以上是关于springboot整合hive-jdbc遇到的坑的主要内容,如果未能解决你的问题,请参考以下文章
springboot整合rocketmq应用(注解方式)+使用中遇到的坑
Spring Boot 里面引入hive-jdbc包,依赖冲突,tomcat启动不了