2017-02-10 46 views
0

我能夠從我的eclipse運行應用程序,但是當我創建jar時,嘗試從命令提示符運行時出現錯誤。我使用的Java 1.8和Eclipse開普勒無法從命令提示符運行彈出式應用程序作爲可運行的jar

@SpringBootApplication 
public class Application { 
    public static void main(String[] args) { 
    ApplicationContext app = SpringApplication.run(Application.class, args); 
    Application application = app.getBean(Application.class); 
    if (args != null && args.length > 0) { 
     application.getAllApiByProject(args); 
    } else { 
     System.out.print("No Arguments found.., Pass Project argument"); 
    } 
    final int exitCode = 0; 
    ExitCodeGenerator exitCodeGenerator = new ExitCodeGenerator() { 

     @Override 
     public int getExitCode() { 
      return exitCode; 
     } 
    }; 
    SpringApplication.exit(app, exitCodeGenerator); 
    System.out.print("Closing App Spring boot"); 
} 

public void getAllApiByProject(String[] args) { 
    System.out.print("Opening App Spring boot"); 
    if (args != null && args.length == 1) { 
     apiService.getAllApiByProject(args[0]); 
    } else { 
     String apiId = args[1]; 
     apiService.getApiById(Integer.parseInt(apiId)); 
    } 
    } 

    @Autowired 
    private ApplicationContext context; 

    @Autowired 
    private ApiService apiService; 

} 

我正在使用下面創建的jar命令

mvn package 
mvn spring-boot:run 

我收到以下錯誤

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] 
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_121] 
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) [na:1.8.0_121] 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1403) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1393) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121] 
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121] 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 6 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 6 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.authenticator.NonLoginAuthenticator[]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 8 common frames omitted 
Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; 
    at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1125) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 10 common frames omitted 

2017-02-10 21:00:24.422 ERROR 4844 --- [   main] org.apache.catalina.core.ContainerBase : A child container failed during start 

java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]] 
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_121] 
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_121] 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:911) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 

org.springframework.boot我.context.embedded.tomcat.TomcatEmbeddedServletContainer。 at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:535)[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] at org.springframework.boot .context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:177)[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext。創建嵌入式服務器容器(EmbeddedWebApplicationContext.java:164)[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)[ spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] at org.springframework.context.suppor t.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536)[spring-context-4.3.5.RELEASE.jar:4.3.5.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java :122)[sun-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] at com.relevancelab.imdg.Application.main(Application.java:17)[classes /:na] at sun。 reflect.NativeMethodAccessorImpl.invoke0(Native Method)〜[na:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_121] at java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_121] at org.springframework.boot.maven .AbstractRu nMojo $ LaunchRunner.run(AbstractRunMojo.java:507)[spring-boot-maven-plugin-1.4.3.RELEASE.jar:1.4.3.RELEASE] at java.lang.Thread.run(Thread.java:745 )[na:1.8.0_121] 原因:org.apache.catalina.LifecycleException:無法啓動組件[StandardEngine [Tomcat] .StandardHost [localhost]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase .java:167)[tomcat-embed-core-8.5.6.jar:8.5.6] at org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1403)〜[tomcat-embed- core-8.5.6.jar:8.5.6] at org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1393)〜[tomcat-embed-core-8.5.6.jar:8.5。 6] at java.util.concurrent.FutureTask.run(FutureTask.java:266)〜[na:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor.runWor KER(ThreadPoolExecutor.java:1142)〜[NA:1.8.0_121] 在java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:617)〜[NA:1.8.0_121] ... 1共同省略框架 引起:org.apache.catalina.LifecycleException:子容器在啓動 時失敗,位於org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)〜[tomcat-embed-core-8.5。 6.jar:8.5.6] 在org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:890)〜[Tomcat的嵌入芯-8.5.6.jar:8.5.6] 在有機apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)[Tomcat的嵌入芯-8.5.6.jar:8.5.6] ...6個共同幀省略

2017-02-10 21:00:24.422 WARN 4844 --- [   main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
2017-02-10 21:00:24.423 INFO 4844 --- [   main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 
2017-02-10 21:00:24.431 ERROR 4844 --- [   main] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at com.relevancelab.imdg.Application.main(Application.java:17) [classes/:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121] 
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121] 
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:507) [spring-boot-maven-plugin-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121] 
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:115) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:82) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:535) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:177) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    ... 14 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:356) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:96) ~[spring-boot-1.4.3.RELEASE.jar:1.4.3.RELEASE] 
    ... 19 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:791) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 21 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 23 common frames omitted 
Caused by: org.apache.catalina.LifecycleException: A child container failed during start 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 25 common frames omitted 

[WARNING] 
java.lang.reflect.InvocationTargetException 
    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.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:507) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) 
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) 
    at com.relevancelab.imdg.Application.main(Application.java:17) 
    ... 6 more 
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 

在 org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ... 14更 所致:org.apache.catalina.LifecycleException :無法啓動組件[StandardServer [-1]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina.startup.Tomcat.start(Tomcat.java: 356) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:96) ... 19更多 原因:org.apache.catalina.LifecycleException:無法啓動組件[StandardService [Tomcat]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina。 core.StandardServer.startInternal(StandardServer.java:791) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 21更多 引起:org.apache.catalina.LifecycleException:無法啓動組件[StandardEngine [Tomcat]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 23更多 引起:org.apache.catalina.LifecycleException:在啓動 時,子容器失敗,位於org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) at org.apache.catalina.core。 StandardEngine.startInternal(StandardEngine.java:262) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 25更多 [錯誤]未能執行目標org.springframework.boot: spring-boot-maven-plugin :1.4.3.RELEASE:在項目IMDG上運行(default-cli):運行時發生異常。 null: InvocationTargetException:無法啓動嵌入容器;嵌套異常是org.springframework.boot.context.embedded.EmbeddedServletContainerException: 無法啓動嵌入式Tomcat: 無法啓動組件[Standar dServer [-1]]:未能啓動組件[StandardService [Tomcat]]:無法啓動組件啓動組件[StandardEngine [Tomcat的]: 子容器啓動時失敗 - > 的依賴關係樹

[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ IMDG --- 
[INFO] relevancelab:IMDG:jar:1.0 
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.3.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.3.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.3.RELEASE:compile 
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.3.RELEASE:compile 
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.8:compile 
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.8:compile 
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.22:compile 
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.22:compile 
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime 
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.3.RELEASE:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.6:compile 
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.6:compile 
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.6:compile 
[INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile 
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile 
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile 
[INFO] | | \- com.fasterxml:classmate:jar:1.3.3:compile 
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.5:compile 
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.5:compile 
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.5:compile 
[INFO] | \- org.springframework:spring-webmvc:jar:4.3.5.RELEASE:compile 
[INFO] |  \- org.springframework:spring-expression:jar:4.3.5.RELEASE:compile 
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.3.RELEASE:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.3.RELEASE:compile 
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile 
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.3.RELEASE:compile 
[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.6:compile 
[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.6:compile 
[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.5.RELEASE:compile 
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.11.Final:compile 
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile 
[INFO] | | +- org.javassist:javassist:jar:3.20.0-GA:compile 
[INFO] | | +- antlr:antlr:jar:2.7.7:compile 
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile 
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile 
[INFO] | | | \- xml-apis:xml-apis:jar:1.4.01:compile 
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile 
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.11.Final:compile 
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile 
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.10.6.RELEASE:compile 
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.12.6.RELEASE:compile 
[INFO] | | +- org.springframework:spring-orm:jar:4.3.5.RELEASE:compile 
[INFO] | | +- org.springframework:spring-tx:jar:4.3.5.RELEASE:compile 
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.22:compile 
[INFO] | \- org.springframework:spring-aspects:jar:4.3.5.RELEASE:compile 
[INFO] +- org.postgresql:postgresql:jar:9.4.1212.jre7:compile 
[INFO] +- com.google.code.gson:gson:jar:2.7:compile 
[INFO] +- org.apache.hadoop:hadoop-core:jar:2.6.0-mr1-cdh5.8.3:compile 
[INFO] | +- commons-cli:commons-cli:jar:1.2:compile 
[INFO] | +- xmlenc:xmlenc:jar:0.52:compile 
[INFO] | +- commons-httpclient:commons-httpclient:jar:3.1:compile 
[INFO] | +- commons-codec:commons-codec:jar:1.10:compile 
[INFO] | +- commons-net:commons-net:jar:3.1:compile 
[INFO] | +- org.mortbay.jetty:jetty:jar:6.1.26.cloudera.2:compile 
[INFO] | +- org.mortbay.jetty:jetty-util:jar:6.1.26.cloudera.2:compile 
[INFO] | +- tomcat:jasper-runtime:jar:5.5.23:compile 
[INFO] | +- tomcat:jasper-compiler:jar:5.5.23:compile 
[INFO] | +- org.codehaus.jackson:jackson-core-asl:jar:1.8.8:compile 
[INFO] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.8:compile 
[INFO] | +- javax.servlet.jsp:jsp-api:jar:2.1:compile 
[INFO] | +- commons-el:commons-el:jar:1.0:compile 
[INFO] | +- net.java.dev.jets3t:jets3t:jar:0.6.1:compile 
[INFO] | +- hsqldb:hsqldb:jar:1.8.0.10:compile 
[INFO] | +- org.eclipse.jdt:core:jar:3.1.1:compile 
[INFO] | \- org.apache.zookeeper:zookeeper:jar:3.4.5-cdh5.8.3:compile 
[INFO] |  +- jline:jline:jar:2.11:compile 
[INFO] |  \- org.jboss.netty:netty:jar:3.2.2.Final:compile 
[INFO] +- org.apache.hive:hive-jdbc:jar:1.1.0-cdh5.4.0:compile 
[INFO] | +- org.apache.hive:hive-common:jar:1.1.0-cdh5.4.0:compile 
[INFO] | | +- log4j:apache-log4j-extras:jar:1.2.17:compile 
[INFO] | | \- org.apache.ant:ant:jar:1.9.1:compile 
[INFO] | |  \- org.apache.ant:ant-launcher:jar:1.9.1:compile 
[INFO] | +- org.apache.hive:hive-service:jar:1.1.0-cdh5.4.0:compile 
[INFO] | | +- net.sf.jpam:jpam:jar:1.1:compile 
[INFO] | | \- org.apache.thrift:libfb303:jar:0.9.2:compile 
[INFO] | +- org.apache.hive:hive-serde:jar:1.1.0-cdh5.4.0:compile 
[INFO] | | +- net.sf.opencsv:opencsv:jar:2.3:compile 
[INFO] | | \- com.twitter:parquet-hadoop-bundle:jar:1.5.0-cdh5.4.0:compile 
[INFO] | +- org.apache.hive:hive-metastore:jar:1.1.0-cdh5.4.0:compile 
[INFO] | | +- com.jolbox:bonecp:jar:0.8.0.RELEASE:compile 
[INFO] | | +- org.apache.derby:derby:jar:10.12.1.1:compile 
[INFO] | | +- org.datanucleus:datanucleus-api-jdo:jar:3.2.6:compile 
[INFO] | | +- org.datanucleus:datanucleus-core:jar:3.2.10:compile 
[INFO] | | +- org.datanucleus:datanucleus-rdbms:jar:3.2.9:compile 
[INFO] | | +- commons-pool:commons-pool:jar:1.6:compile 
[INFO] | | +- commons-dbcp:commons-dbcp:jar:1.4:compile 
[INFO] | | +- javax.jdo:jdo-api:jar:3.0.1:compile 
[INFO] | | | \- javax.transaction:jta:jar:1.1:compile 
[INFO] | | \- org.antlr:antlr-runtime:jar:3.4:compile 
[INFO] | |  \- org.antlr:stringtemplate:jar:3.2.1:compile 
[INFO] | +- org.apache.hive:hive-shims:jar:1.1.0-cdh5.4.0:compile 
[INFO] | | +- org.apache.hive.shims:hive-shims-common:jar:1.1.0-cdh5.4.0:compile 
[INFO] | | +- org.apache.hive.shims:hive-shims-0.23:jar:1.1.0-cdh5.4.0:runtime 
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-resourcemanager:jar:2.6.0-cdh5.4.0:runtime 
[INFO] | | |  +- com.google.inject.extensions:guice-servlet:jar:3.0:runtime 
[INFO] | | |  +- com.google.inject:guice:jar:3.0:runtime 
[INFO] | | |  | +- javax.inject:javax.inject:jar:1:runtime 
[INFO] | | |  | \- aopalliance:aopalliance:jar:1.0:runtime 
[INFO] | | |  +- com.sun.jersey.contribs:jersey-guice:jar:1.9:runtime 
[INFO] | | |  +- org.codehaus.jettison:jettison:jar:1.1:runtime 
[INFO] | | |  +- org.apache.hadoop:hadoop-yarn-server-applicationhistoryservice:jar:2.6.0-cdh5.4.0:runtime 
[INFO] | | |  \- org.apache.hadoop:hadoop-yarn-server-web-proxy:jar:2.6.0-cdh5.4.0:runtime 
[INFO] | | \- org.apache.hive.shims:hive-shims-scheduler:jar:1.1.0-cdh5.4.0:runtime 
[INFO] | +- commons-logging:commons-logging:jar:1.1.3:compile 
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile 
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile 
[INFO] | +- org.apache.thrift:libthrift:jar:0.9.2:compile 
[INFO] | +- org.apache.curator:curator-framework:jar:2.6.0:compile 
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.22:compile 
[INFO] | \- org.slf4j:slf4j-log4j12:jar:1.7.22:compile 
[INFO] +- org.apache.hadoop:hadoop-common:jar:2.7.3:compile 
[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.7.3:compile 
[INFO] | | \- jdk.tools:jdk.tools:jar:1.8:system 
[INFO] | +- com.google.guava:guava:jar:11.0.2:compile 
[INFO] | +- org.apache.commons:commons-math3:jar:3.1.1:compile 
[INFO] | +- commons-io:commons-io:jar:2.4:compile 
[INFO] | +- commons-collections:commons-collections:jar:3.2.2:compile 
[INFO] | +- log4j:log4j:jar:1.2.17:compile 
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile 
[INFO] | +- commons-configuration:commons-configuration:jar:1.6:compile 
[INFO] | | +- commons-digester:commons-digester:jar:2.1:compile 
[INFO] | | | \- commons-beanutils:commons-beanutils:jar:1.9.3:compile 
[INFO] | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile 
[INFO] | +- org.apache.avro:avro:jar:1.7.4:compile 
[INFO] | | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile 
[INFO] | | \- org.xerial.snappy:snappy-java:jar:1.0.4.1:compile 
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile 
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.7.3:compile 
[INFO] | | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile 
[INFO] | |  +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile 
[INFO] | |  +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile 
[INFO] | |  \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile 
[INFO] | +- org.apache.curator:curator-client:jar:2.7.1:compile 
[INFO] | +- org.apache.curator:curator-recipes:jar:2.7.1:compile 
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.0:compile 
[INFO] | +- org.apache.htrace:htrace-core:jar:3.1.0-incubating:compile 
[INFO] | \- org.apache.commons:commons-compress:jar:1.4.1:compile 
[INFO] |  \- org.tukaani:xz:jar:1.0:compile 
[INFO] +- org.apache.hadoop:hadoop-client:jar:2.7.3:compile 
[INFO] | +- org.apache.hadoop:hadoop-hdfs:jar:2.7.3:compile 
[INFO] | | +- io.netty:netty:jar:3.6.2.Final:compile 
[INFO] | | +- io.netty:netty-all:jar:4.0.23.Final:compile 
[INFO] | | +- xerces:xercesImpl:jar:2.9.1:compile 
[INFO] | | \- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile 
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.7.3:compile 
[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.7.3:compile 
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.7.3:compile 
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.7.3:compile 
[INFO] | | \- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.7.3:compile 
[INFO] | +- org.apache.hadoop:hadoop-yarn-api:jar:2.7.3:compile 
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.7.3:compile 
[INFO] | | \- org.apache.hadoop:hadoop-yarn-common:jar:2.7.3:compile 
[INFO] | |  +- javax.xml.bind:jaxb-api:jar:2.2.2:compile 
[INFO] | |  | +- javax.xml.stream:stax-api:jar:1.0-2:compile 
[INFO] | |  | \- javax.activation:activation:jar:1.1:compile 
[INFO] | |  +- javax.servlet:servlet-api:jar:2.5:compile 
[INFO] | |  +- com.sun.jersey:jersey-core:jar:1.9:compile 
[INFO] | |  +- com.sun.jersey:jersey-client:jar:1.9:compile 
[INFO] | |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile 
[INFO] | |  \- org.codehaus.jackson:jackson-xc:jar:1.9.13:compile 
[INFO] | \- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.7.3:compile 
[INFO] \- org.springframework:spring-web:jar:4.3.5.RELEASE:compile 
[INFO] +- org.springframework:spring-aop:jar:4.3.5.RELEASE:compile 
[INFO] +- org.springframework:spring-beans:jar:4.3.5.RELEASE:compile 
[INFO] +- org.springframework:spring-context:jar:4.3.5.RELEASE:compile 
[INFO] \- org.springframework:spring-core:jar:4.3.5.RELEASE:compile 
[INFO] -------------------------------------------------------------------- 
+0

Tomcat未能啓動。之所以會出現在日誌輸出中。你可以分享啓動你的應用程序的所有輸出? –

+0

@AndyWilkinson,更新完整的錯誤 –

+0

@AndyWilkinson,我已經添加了依賴樹,可以幫助我解決衝突,我試過但無法解決 –

回答

5

失敗的根本原因是這樣的:

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; 
    at org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1125) ~[tomcat-embed-core-8.5.6.jar:8.5.6] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.6.jar:8.5.6] 
    ... 10 common frames omitted 

這告訴我,你有一箇舊版本(可能是2.5)的類路徑上的Servlet API。您正在使用Tomcat 8.5.6,它是一個兼容Servlet 3.1的服務器。使用mvn dependency:tree來確定舊Servlet API的位置,然後將<exclusion>添加到您的pom以擺脫它。

相關問題