我正在使用Spring Boot来构建我的AngularJS Web应用程序。这是pom.xml:
<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>supervision</groupId>
<artifactId>SUPERVISION</artifactId>
<version>0.1.0.RELEASE</version>
<packaging>war</packaging>
<name>SUPERVISION</name>
<description>SUPERVISION FRONT END + SERVLET</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath />
</parent>
<properties>
<start-class>supervision.SupervisionServlet</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
servlet和前端在Tomcat 8.0上运行正常但由于某种原因我必须通过Jboss 4.2.2部署应用程序。当我将war文件放在Jboss deploy文件夹中时,它会返回此警告并找不到404页面:
WARN [javax.enterprise.resource.webcontainer.jsf.config] Unable to process deployment descriptor for context '/SUPERVISION-0.1.0.RELEASE'
我已经尝试在application.properties文件中添加server.servlet-path = / *,但它没有解决我的问题。
有关如何解决此问题的任何想法?
答案 0 :(得分:0)
由于你实际上没有在tomcat上运行,所以不要声明提供它而是尝试排除它。
<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>