apache tomcat启动失败,项目库文件夹中的phoenix-5.0.0-hbase-2.0-client.jar

lvmkulzt  于 2021-07-15  发布在  Hadoop
关注(0)|答案(1)|浏览(373)

我有一个连接到apachephoenix的web应用程序;因此,我将phoenix-5.0.0-hbase-2.0-client.jar添加到dependencies中,它在本地的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。

xmq68pz9

xmq68pz91#

欢迎来到地狱!jar文件 phoenix-5.0.0-HBase-2.0-client.jar 包含相当于170个jar文件(下面作为maven列出) groupId:artifactId:version ). 具体来说,它包含了jersey 1.19,而您已经有了jersey 2.15。每当你的类路径上有同一个库的多个版本时,你就会得到与你的问题相同的链接错误。一个jersey库(可能是2.15)试图加载依赖项,但该依赖项来自另一个版本(可能是1.19)。
解决办法是不要用像这样的肥jar phoenix-5.0.0-HBase-2.0-client.jar ,但使用maven或其他系统来处理依赖关系。他们可能仍然会弄错(例如com.sun.xml.bind和org.glassfish.jaxb的版本) jaxb-core 包含相同的类,但maven不知道),但结果比手动依赖关系管理要好得多。
在你的情况下,如果你只是需要 org.apache.phoenix.jdbc.PhoenixDriver 你需要包括Phoenix核心神器,让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

相关问题