我能够从我的eclipse运行应用程序,但是当我创建jar时,尝试从命令提示符运行它会产生错误。我正在使用Java1.8和eclipse kepler
@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;
}
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]
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
[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] --------------------------------------------------------------------
失败的根本原因是这样的:
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。您使用的是Tomcat8.5.6,这是一个与Servlet3.1兼容的服务器。使用MVN dependency:tree
来标识旧Servlet API被拉入的位置,然后将
添加到pom中以消除它。
我最近开始学习Java编程语言的基础知识。为了在命令提示符下运行我的程序,我下载了java开发工具包(也称为JDK),并将我的Windows10系统路径设置为: C:\Program Files\java\jdk-9.0.1\bin;C:\Program Files\java\jre-9.0.1\bin 在用以下格式编写了一个简单的Hello World程序后: 并在命令提示符下使用 ,然后写 j
我在从命令行运行一个java程序时遇到了严重的麻烦。我觉得我已经接近弄清楚哪里出了问题,但我只是不知所措,我需要帮助。 我正在尝试用以下命令运行一个简单的Hello World程序(在windows上的VSCode中,使用bash terminal): 这根本不起作用,但是,写入文件的完整路径确实起作用,所以像这样的东西是起作用的。 此外,使用F5运行文件也可以正常工作。我希望用命令行参数运行我的
要执行一个jar命令,请使用>Java-jar jar-file-name.jar 如果JAVA_HOME版本与使用构建的jar文件的JDK版本匹配,则工作很好。否则会给出以下错误。 我有一个在JDK1.8中构建的第三方jar,在这个JDK上我没有任何控制权来更改和重建JDK版本。 我有一台unix机器,其中的JAVA_HOME设置为JDK1.5。而我的应用程序是部署在同一台机器中的其他几个应用程
问题内容: 我们如何在命令提示符下运行jar文件? 问题答案: 尝试这个
问题内容: 我创建了一个Java项目来调用Web服务。它具有一个Main java文件和另一个class文件。我已经将一些jar文件用于HTTP客户端。 在Eclipse中,它运行良好。我需要通过传递一些参数在命令提示符下运行Java程序。 在命令提示符下,我转到包含主Java和子类Java文件的src文件夹,并给出了以下命令 我收到以下错误 mainjava.java:14:找不到符号 symb
这里的子类是我的另一个java类文件,用于调用web服务。 如何通过传递参数运行程序?