我用scala Rest api创建了spring boot,它正在使用jar文件与tomcat(默认服务器)一起工作。现在我想部署到Jboss/Wildfly 10.0中并创建war文件。在部署期间,我遇到了以下问题。有人能在这个问题上帮忙吗。
POM文件:
<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.aexp.prospect</groupId>
<artifactId>atules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>atules</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath />
</parent>
<properties>
<start-class>com.aexp.prospect.atules.AtulApplication</start-class>
<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>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>net.liftweb</groupId>
<artifactId>lift-json_2.11</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
</dependencies>
<build>
<finalName>SpringBootES</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
部署时出现错误消息:
13:56:38,104 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0001: Content added at location C:\Risk_Mgt\Downloads\wildfly-10.0.0.Final\standalone\data\content\76\46dbc0aa1700b71ef90ada1bc3c326e8d02776\content
13:56:38,109 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with driver-name = SpringBootES.war_org.h2.Driver_1_4
13:56:38,119 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool
13:56:38,126 INFO [io.undertow.servlet] (ServerService Thread Pool
13:56:38,127 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (ServerService Thread Pool
13:56:38,129 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] (ServerService Thread Pool
13:56:40,019 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment SpringBootES.war (runtime-name: SpringBootES.war) in 1913ms
13:56:40,023 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "SpringBootES.war" (runtime-name: "SpringBootES.war")
13:56:51,926 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
13:56:51,928 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
13:56:52,006 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
13:56:52,012 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = SpringBootES.war_org.h2.Driver_1_4
13:56:52,093 INFO [io.undertow.servlet] (ServerService Thread Pool
13:56:53,033 INFO [stdout] (ServerService Thread Pool
13:56:53,033 INFO [stdout] (ServerService Thread Pool
13:56:53,034 INFO [stdout] (ServerService Thread Pool
13:56:53,034 INFO [stdout] (ServerService Thread Pool
13:56:53,034 INFO [stdout] (ServerService Thread Pool
13:56:53,034 INFO [stdout] (ServerService Thread Pool
13:56:53,035 INFO [stdout] (ServerService Thread Pool
13:56:53,055 INFO [stdout] (ServerService Thread Pool
13:56:53,056 INFO [stdout] (ServerService Thread Pool
13:56:53,241 INFO [com.aexp.prospect.atules.AtulApplication] (ServerService Thread Pool
13:56:53,241 INFO [com.aexp.prospect.atules.AtulApplication] (ServerService Thread Pool
13:56:53,304 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (ServerService Thread Pool
13:56:55,604 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (ServerService Thread Pool
13:56:55,877 INFO [io.undertow.servlet] (ServerService Thread Pool
13:56:55,878 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool
13:56:57,166 INFO [org.springframework.boot.web.servlet.ServletRegistrationBean] (ServerService Thread Pool
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool
13:56:58,042 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (ServerService Thread Pool
13:56:58,226 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool
13:56:58,235 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool
13:56:58,235 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool
13:56:58,306 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool
13:56:58,306 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool
13:56:58,503 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool
13:56:58,924 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] (ServerService Thread Pool
13:56:58,988 INFO [com.aexp.prospect.atules.AtulApplication] (ServerService Thread Pool
13:56:58,994 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool
13:57:03,889 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool
13:57:03,975 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0016: Replaced deployment "SpringBootES.war" with deployment "SpringBootES.war"
13:57:03,976 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.undertow.deployment.default-server.default-host."/atules-0.0.1-SNAPSHOT": org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host."/atules-0.0.1-SNAPSHOT": java.lang.RuntimeException: javax.servlet.ServletException: Failed to instantiate WebApplicationInitializer class
13:57:03,986 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location C:\Risk_Mgt\Downloads\wildfly-10.0.0.Final\standalone\data\content\e4\796fce1370fb5d7b11d99012c33f8a30730b2a\content