当前位置: 首页 > 知识库问答 >
问题:

apache tomcat启动失败,project lib文件夹中的Phoenix-5.0.0-hbase-2.0-client.jar

凌昕
2023-03-14

我有一个连接到apache Phoenix的web应用程序;因此,我将Phoenix-5.0.0-hbase-2.0-client.jar添加到依赖项中,它在本地的intellij中工作得很好,但是当我在服务器中启动tomcat时,我得到了以下错误消息:

org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)
        Caused by: java.lang.NoSuchMethodError: org.glassfish.jersey.servlet.internal.Utils.store(Lorg/glassfish/jersey/server/ResourceConfig;Ljavax/servlet/ServletContext;)V
                at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.addServletWithExistingRegistration(JerseyServletContainerInitializer.java:310)
                at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartupImpl(JerseyServletContainerInitializer.java:170)
                at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartup(JerseyServletContainerInitializer.java:143)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
                ... 10 more
07-Feb-2021 09:10:32.298 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory 
        java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

当我从projects lib文件夹中删除phoenix-5.0.0-hbase-2.0-client.jar时,这个问题就解决了!服务器的操作系统是CentOS。我不使用spring boot、gradle或Maven。

共有1个答案

孟光耀
2023-03-14

欢迎来到依赖地狱!jar文件phoenix-5.0.0-hbase-2.0-client.jar包含相当于170个jar文件(下面列出为Mavengroupid:artifactid:version)。具体地说,它包含泽西1.19,而您已经有泽西2.15。每当类路径上有同一个库的多个版本时,就会出现问题中的链接错误。一个Jersey库(可能是2.15)试图加载一个依赖项,但该依赖项来自另一个版本(可能是1.19)。

解决方案不是使用像phoenix-5.0.0-hbase-2.0-client.jar这样的胖jar,而是使用Maven或其他系统来处理依赖关系。他们可能仍然会弄错(例如,com.sun.xml.bind和org.glassfish.jaxb版本的jaxb-core包含相同的类,但Maven不知道这一点),但结果比手动依赖管理好得多。

在您的示例中,如果只需要org.apache.phoenix.jdbc.phoenixDriver,则需要包含phoenix-core工件,并让Maven完成其余的工作。

您最终会得到许多无用的依赖关系(例如,您可以立即排除Jetty*依赖关系,因为这些依赖关系是Jetty Servlet容器的库,如果连接到外部库,还可以排除hbase-server),但希望不会发生冲突。

com.clearspring.analytics:stream:2.9.5
com.fasterxml.jackson.core:jackson-annotations:2.4.0
com.fasterxml.jackson.core:jackson-core:2.4.0
com.fasterxml.jackson.core:jackson-databind:2.4.0
com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.7.8
com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.7.8
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.7.8
com.fasterxml.woodstox:woodstox-core:5.0.3
com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1
com.github.stephenc.jcip:jcip-annotations:1.0-1
com.google.code.gson:gson:2.8.1
com.google.guava:guava:13.0.1
com.google.protobuf:protobuf-java-util:3.3.0
com.google.protobuf:protobuf-java:2.5.0
com.google.re2j:re2j:1.1
com.jcraft:jsch:0.1.54
com.nimbusds:nimbus-jose-jwt:4.41.1
com.salesforce.i18n:i18n-util:1.0.4
com.squareup.okhttp:okhttp:2.4.0
com.squareup.okio:okio:1.4.0
com.sun.jersey.contribs:jersey-guice:1.19
com.sun.jersey:jersey-client:1.19
com.sun.jersey:jersey-core:1.19
com.sun.jersey:jersey-json:1.19
com.sun.jersey:jersey-server:1.19
com.sun.jersey:jersey-servlet:1.19
com.tdunning:json:1.8
com.thoughtworks.paranamer:paranamer:2.3
commons-beanutils:commons-beanutils:1.9.3
commons-cli:commons-cli:1.4
commons-codec:commons-codec:1.7
commons-collections:commons-collections:3.2.2
commons-daemon:commons-daemon:1.0.13
commons-io:commons-io:2.5
commons-lang:commons-lang:2.6
commons-logging:commons-logging:1.2
commons-net:commons-net:3.1
io.dropwizard.metrics:metrics-core:3.1.0
io.netty:netty-all:4.1.17.Final
io.netty:netty:3.10.5.Final
javax.annotation:javax.annotation-api:1.2
javax.servlet.jsp:javax.servlet.jsp-api:2.3.1
javax.servlet:javax.servlet-api:3.1.0
javax.validation:validation-api:1.1.0.Final
javax.ws.rs:javax.ws.rs-api:2.0.1
javax.ws.rs:jsr311-api:1.1.1
javax.xml.bind:jaxb-api:2.2.11
jline:jline:2.11
log4j:log4j:1.2.17
net.minidev:accessors-smart:1.1
net.minidev:json-smart:2.2.1
org.antlr:antlr-runtime:3.5.2
org.apache.avro:avro-ipc:1.7.3
org.apache.avro:avro:1.7.7
org.apache.commons:commons-collections4:4.1
org.apache.commons:commons-compress:1.4.1
org.apache.commons:commons-configuration2:2.1.1
org.apache.commons:commons-crypto:1.0.0
org.apache.commons:commons-csv:1.0
org.apache.commons:commons-lang3:3.6
org.apache.commons:commons-math3:3.6.1
org.apache.curator:curator-client:2.12.0
org.apache.curator:curator-framework:2.12.0
org.apache.curator:curator-recipes:2.12.0
org.apache.flume:flume-ng-configuration:1.4.0
org.apache.flume:flume-ng-core:1.4.0
org.apache.flume:flume-ng-sdk:1.4.0
org.apache.hadoop:hadoop-annotations:3.0.0
org.apache.hadoop:hadoop-auth:3.0.0
org.apache.hadoop:hadoop-client:3.0.0
org.apache.hadoop:hadoop-common:3.0.0
org.apache.hadoop:hadoop-distcp:2.7.4
org.apache.hadoop:hadoop-hdfs-client:3.0.0
org.apache.hadoop:hadoop-hdfs:3.0.0
org.apache.hadoop:hadoop-mapreduce-client-common:3.0.0
org.apache.hadoop:hadoop-mapreduce-client-core:3.0.0
org.apache.hadoop:hadoop-mapreduce-client-jobclient:3.0.0
org.apache.hadoop:hadoop-yarn-api:3.0.0
org.apache.hadoop:hadoop-yarn-common:3.0.0
org.apache.hbase.thirdparty:hbase-shaded-miscellaneous:2.1.0
org.apache.hbase.thirdparty:hbase-shaded-netty:2.1.0
org.apache.hbase.thirdparty:hbase-shaded-protobuf:2.1.0
org.apache.hbase:hbase-annotations:2.0.0
org.apache.hbase:hbase-client:2.0.0
org.apache.hbase:hbase-common:2.0.0
org.apache.hbase:hbase-hadoop-compat:2.0.0
org.apache.hbase:hbase-hadoop2-compat:2.0.0
org.apache.hbase:hbase-http:2.0.0
org.apache.hbase:hbase-mapreduce:2.0.0
org.apache.hbase:hbase-metrics-api:2.0.0
org.apache.hbase:hbase-metrics:2.0.0
org.apache.hbase:hbase-procedure:2.0.0
org.apache.hbase:hbase-protocol-shaded:2.0.0
org.apache.hbase:hbase-protocol:2.0.0
org.apache.hbase:hbase-replication:2.0.0
org.apache.hbase:hbase-server:2.0.0
org.apache.hbase:hbase-zookeeper:2.0.0
org.apache.htrace:htrace-core4:4.2.0-incubating
org.apache.htrace:htrace-core:3.1.0-incubating
org.apache.httpcomponents:httpclient:4.0.1
org.apache.httpcomponents:httpcore:4.0.1
org.apache.kerby:kerb-admin:1.0.1
org.apache.kerby:kerb-client:1.0.1
org.apache.kerby:kerb-common:1.0.1
org.apache.kerby:kerb-core:1.0.1
org.apache.kerby:kerb-crypto:1.0.1
org.apache.kerby:kerb-identity:1.0.1
org.apache.kerby:kerb-server:1.0.1
org.apache.kerby:kerb-simplekdc:1.0.1
org.apache.kerby:kerb-util:1.0.1
org.apache.kerby:kerby-asn1:1.0.1
org.apache.kerby:kerby-config:1.0.1
org.apache.kerby:kerby-pkix:1.0.1
org.apache.kerby:kerby-util:1.0.1
org.apache.kerby:kerby-xdr:1.0.1
org.apache.kerby:token-provider:1.0.1
org.apache.mina:mina-core:2.0.4
org.apache.phoenix:phoenix-core:5.0.0-HBase-2.0
org.apache.phoenix:phoenix-flume:5.0.0-HBase-2.0
org.apache.phoenix:phoenix-pig:5.0.0-HBase-2.0
org.apache.phoenix:phoenix-spark:5.0.0-HBase-2.0
org.apache.tephra:tephra-api:0.14.0-incubating
org.apache.tephra:tephra-core:0.14.0-incubating
org.apache.tephra:tephra-hbase-compat-2.0:0.14.0-incubating
org.apache.twill:twill-api:0.8.0
org.apache.twill:twill-common:0.8.0
org.apache.twill:twill-core:0.8.0
org.apache.twill:twill-discovery-api:0.8.0
org.apache.twill:twill-discovery-core:0.8.0
org.apache.twill:twill-zookeeper:0.8.0
org.apache.yetus:audience-annotations:0.5.0
org.codehaus.jettison:jettison:1.3.8
org.codehaus.woodstox:stax2-api:3.1.4
org.eclipse.jetty:jetty-http:9.3.19.v20170502
org.eclipse.jetty:jetty-io:9.3.19.v20170502
org.eclipse.jetty:jetty-security:9.3.19.v20170502
org.eclipse.jetty:jetty-server:9.3.19.v20170502
org.eclipse.jetty:jetty-servlet:9.3.19.v20170502
org.eclipse.jetty:jetty-util-ajax:9.3.19.v20170502
org.eclipse.jetty:jetty-util:9.3.19.v20170502
org.eclipse.jetty:jetty-webapp:9.3.19.v20170502
org.eclipse.jetty:jetty-xml:9.3.19.v20170502
org.fusesource.leveldbjni:leveldbjni-all:1.8
org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32
org.glassfish.hk2.external:javax.inject:2.5.0-b32
org.glassfish.hk2:hk2-api:2.5.0-b32
org.glassfish.hk2:hk2-locator:2.5.0-b32
org.glassfish.hk2:hk2-utils:2.5.0-b32
org.glassfish.hk2:osgi-resource-locator:1.0.1
org.glassfish.jersey.bundles.repackaged:jersey-guava:2.25.1
org.glassfish.jersey.containers:jersey-container-servlet-core:2.25.1
org.glassfish.jersey.core:jersey-client:2.25.1
org.glassfish.jersey.core:jersey-common:2.25.1
org.glassfish.jersey.core:jersey-server:2.25.1
org.glassfish.jersey.media:jersey-media-jaxb:2.25.1
org.glassfish.web:javax.servlet.jsp:2.3.2
org.glassfish:javax.el:3.0.1-b11-SNAPSHOT
org.iq80.snappy:snappy:0.3
org.jamon:jamon-runtime:2.4.1
org.javassist:javassist:3.20.0-GA
org.jruby.jcodings:jcodings:1.0.18
org.jruby.joni:joni:2.1.2
org.jvnet:tiger-types:1.4
org.mortbay.jetty:jetty-util:6.1.26
org.mortbay.jetty:jetty:6.1.26
org.mortbay.jetty:servlet-api:2.5-20110124
org.slf4j:slf4j-api:1.6.4
org.slf4j:slf4j-log4j12:1.7.25
org.xerial.snappy:snappy-java:1.0.5
sqlline:sqlline:1.2.0
 类似资料:
  • HBase和Hadoop在Docker中是CDH独立模式。ZK、HBASE、Phoenix使用shell都可以操作。java操作zk也可以,但是java不能操作Hbase和phoenix,代码可以。有人能帮我吗,谢谢!

  • 我无法启动安装在HBASE上的apache phoenix。当我尝试执行py文件时,我得到以下错误。请告知

  • 将文件从documentdirectory移动到子目录的简单脚本不起作用 移动失败,错误为:操作无法完成。(可可错误4。) 我用Xcode的模拟器来尝试它。下面的函数返回true,因为文件存在于DocumentDirectory中。此外,destinationfolder存在,destinationfolder为空。 /Users/RWollenSchlaeger/Library/Develope

  • 我在3个节点上以完全分布式模式配置HBase 1.0.1.1。Node-1应该运行主服务器zookeeper和RegionServer;Node-2应该运行zookeeper&regionserver;Node-3应该运行Backup Master、zookeeper和RegionServer。我在安装过程中遇到了两个问题,需要您的帮助-1)当我运行start-hbase.sh时,我看到“hmas

  • 一、Phoenix简介 Phoenix 是 HBase 的开源 SQL 中间层,它允许你使用标准 JDBC 的方式来操作 HBase 上的数据。在 Phoenix 之前,如果你要访问 HBase,只能调用它的 Java API,但相比于使用一行 SQL 就能实现数据查询,HBase 的 API 还是过于复杂。Phoenix 的理念是 we put sql SQL back in NOSQL,即你可

  • 在Tomcat8中部署/替换类文件后,我得到了以下错误。我还没能找到(或正确地实现)手头问题的解决方案。任何帮助都将不胜感激!