我使用的是Spring Boot版本1.15,并且在运行应用程序时遇到上述错误。
POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.app</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>sendres</name>
<description>Spring Boot Project for Sendres</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.15.BUILD-SNAPSHOT</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/com.springsource.org.apache.commons.lang -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.lang</artifactId>
<version>2.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/oracle/ojdbc6 -->
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> -->
<!-- https://mvnrepository.com/artifact/net.sourceforge.stripes/stripes -->
<dependency>
<groupId>net.sourceforge.stripes</groupId>
<artifactId>stripes</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-orm -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.0.3.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.htmlparser.jericho/jericho-html -->
<dependency>
<groupId>net.htmlparser.jericho</groupId>
<artifactId>jericho-html</artifactId>
<version>3.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency> -->
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-client -->
<!-- <dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19.4</version>
</dependency> -->
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-core -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.19</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-client -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.jms/javax.jms-api -->
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.pingidentity</groupId>
<artifactId>opentoken-agent</artifactId>
<version>2.5.0</version>
<scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/opentoken-agent-2.5.0.jar</systemPath>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-dbcp/commons-dbcp -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-pool/commons-pool -->
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!-- JSTL for JSP -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- Need this to compile JSP -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jibx/jibx-run -->
<dependency>
<groupId>org.jibx</groupId>
<artifactId>jibx-run</artifactId>
<version>1.2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jibx/jibx-bind -->
<dependency>
<groupId>org.jibx</groupId>
<artifactId>jibx-bind</artifactId>
<version>1.2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jibx/jibx-schema -->
<dependency>
<groupId>org.jibx</groupId>
<artifactId>jibx-schema</artifactId>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>org.jibx</groupId>
<artifactId>jibx-extras</artifactId>
<version>1.2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.4.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity-tools -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<!-- <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.9</version>
</dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jibx</groupId>
<artifactId>jibx-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<schemaBindingDirectory>src/main/java/jibx/xml/mappings/</schemaBindingDirectory>
<includeSchemaBindings>
<includeSchemaBindings>*.xml</includeSchemaBindings>
</includeSchemaBindings>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<goals>
<goal>bind</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-plugin-apache-lang</id>
<name>spring-plugin-apache-lang</name>
<url>http://repo.spring.io/plugins-release</url>
</repository>
<repository>
<id>spring-plugin-oracle-jdbc</id>
<name>spring-plugin-oracle-jdbc</name>
<url>http://www.datanucleus.org/downloads/maven2/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
获取错误:-
2018-06-27 14:52:00.662错误52260 --- [restartedMain] o.s.boot.SpringApplication:应用程序启动失败
org.springframework.context.ApplicationContextException:无法启动嵌入式容器。嵌套的异常是org.springframework.boot.context.embedded.EmbeddedServletContainerException:无法启动嵌入式Tomcat 在org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)〜[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE] 在org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)上[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)上[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.SpringApplication.run(SpringApplication.java:303)上[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)上[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)上[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在com.gartner.SendresApplication.main(SendresApplication.java:23)[classes /:na] 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)〜[na:1.8.0_171] 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)〜[na:1.8.0_171] 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)〜[na:1.8.0_171] 在java.lang.reflect.Method.invoke(Method.java:498)〜[na:1.8.0_171] 在org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)[spring-boot-devtools-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 引起原因:org.springframework.boot.context.embedded.EmbeddedServletContainerException:无法启动嵌入式Tomcat 在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:138)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer。(TomcatEmbeddedServletContainer.java:87)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:554)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:179)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:164)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] 在org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] ...省略了13个通用框架 原因:org.apache.catalina.LifecycleException:无法启动组件[StandardServer [-1]] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.startup.Tomcat.start(Tomcat.java:346)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:114)〜[spring-boot-1.5.15.BUILD-SNAPSHOT.jar:1.5.15.BUILD-SNAPSHOT] ...省略了18个通用框架 原因:org.apache.catalina.LifecycleException:无法启动组件[StandardService [Tomcat]] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:787)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)〜[tomcat-embed-core-8.0.36.jar:8.0.36] ...省略了20个通用框架 原因:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Tomcat]] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.core.StandardService.startInternal(StandardService.java:441)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)〜[tomcat-embed-core-8.0.36.jar:8.0.36] ...省略了22个通用框架 由以下原因引起:org.apache.catalina.LifecycleException:子容器在启动期间失败 在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:923)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)〜[tomcat-embed-core-8.0.36.jar:8.0.36] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)〜[tomcat-embed-core-8.0.36.jar:8.0.36] ...省略了24个共同的框架
添加跟踪依赖后的问题
<!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.6.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity-tools -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<!-- <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.9</version>
</dependency> -->