gpt4 book ai didi

java - 在库文件中使用hive-jdbc-2.0.0-standalone.jar时,jsp文件失败

转载 作者:行者123 更新时间:2023-12-02 21:21:44 25 4
gpt4 key购买 nike

我正在尝试通过 hive jdbc连接使用apache-tomcat-7.0.41。当我将应用程序部署到tomcat服务器时,出现以下错误

错误:

Created dir: /usr/local/NetBeansProjects/BDGRUSDML/build/generated/src
Created dir: /usr/local/NetBeansProjects/BDGRUSDML/build/generated/classes
Compiling 1 source file to /usr/local/NetBeansProjects/BDGRUSDML/build/generated/classes
In-place deployment at /usr/local/NetBeansProjects/BDGRUSDML/build/web
Deployment is in progress...
deploy?config=file%3A%2Ftmp%2Fcontext6237817659666739256.xml&path=/BDGRUSDML
FAIL - Deployed application at context path /BDGRUSDML but context failed to start
/usr/local/NetBeansProjects/BDGRUSDML/nbproject/build-impl.xml:1385: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 11 seconds)

服务器日志:
May 07, 2016 8:30:41 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-7-openjdk-i386/jre/lib/amd64:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386::/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib
May 07, 2016 8:30:42 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8084"]
May 07, 2016 8:30:42 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May 07, 2016 8:30:42 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1644 ms
May 07, 2016 8:30:42 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 07, 2016 8:30:42 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.41
May 07, 2016 8:30:42 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /home/shubhangi/.netbeans/7.4/apache-tomcat-7.0.41.0_base/conf/Catalina/localhost/BDGRUSDML.xml
May 07, 2016 8:30:44 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/NetBeansProjects/BDGRUSDML/build/web/WEB-INF/lib/hive-jdbc-2.0.0-standalone.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
May 07, 2016 8:30:45 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/NetBeansProjects/BDGRUSDML/build/web/WEB-INF/lib/jsp-api-2.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
May 07, 2016 8:30:45 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/NetBeansProjects/BDGRUSDML/build/web/WEB-INF/lib/servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
May 07, 2016 8:30:45 PM org.apache.catalina.startup.ContextConfig getServletContainerInitializer
SEVERE: The ServletContentInitializer [org.apache.logging.log4j.web.Log4jServletContainerInitializer] could not be created
java.lang.ClassNotFoundException: org.apache.logging.log4j.web.Log4jServletContainerInitializer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:278)
at org.apache.catalina.startup.ContextConfig.getServletContainerInitializer(ContextConfig.java:1652)
at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1562)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

May 07, 2016 8:30:45 PM org.apache.catalina.startup.ContextConfig processServletContainerInitializers
SEVERE: Failed to process JAR found at URL [jar:file:/usr/local/NetBeansProjects/BDGRUSDML/build/web/WEB-INF/lib/hive-jdbc-2.0.0-standalone.jar!/] for ServletContainerInitializers for context with name [/BDGRUSDML]
May 07, 2016 8:30:45 PM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
May 07, 2016 8:30:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
May 07, 2016 8:30:45 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/BDGRUSDML] startup failed due to previous errors
May 07, 2016 8:30:46 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /home/shubhangi/.netbeans/7.4/apache-tomcat-7.0.41.0_base/conf/Catalina/localhost/ROOT.xml
May 07, 2016 8:30:46 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor /home/shubhangi/.netbeans/7.4/apache-tomcat-7.0.41.0_base/conf/Catalina/localhost/manager.xml
May 07, 2016 8:30:46 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8084"]
May 07, 2016 8:30:46 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 07, 2016 8:30:46 PM org.apache.catalina.startup.Catalina start

我无需使用hive-jdbc-2.0.0-standalone.jar lib即可运行我的代码。但是在那种情况下,我的 hive JDBC连接抛出异常
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hive/service/cli/thrift/TCLIService$Iface
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at HiveConnector.HiveConnect.<init>(HiveConnect.java:27)
at HiveConnector.HiveConnect.main(HiveConnect.java:42)
Caused by: java.lang.ClassNotFoundException: org.apache.hive.service.cli.thrift.TCLIService$Iface
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 5 more
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:107)
Java Result: 1

最佳答案

在尝试其他一些Hive库之后,找到了解决方案。
删除了 hive-jdbc-2.0.0-standalone.jar
并添加
hive-common-2.0.0.jar
hive-exec-2.0.0.jar
hive-metastore-2.0.0.jar
hive-serde-2.0.0.jar
Libs / hive-service-2.0.0.jar


不要删除问题,因为它可以帮助其他人。

关于java - 在库文件中使用hive-jdbc-2.0.0-standalone.jar时,jsp文件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37090523/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com