第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

在jetty容器下部署失敗,希望得到老師或者大家的幫助

老師,我寫了一個(gè)簡單示例程序,打包成war,部署在jetty(jetty 9.x)容器下一直不能啟動項(xiàng)目,不知道什么原因,也沒有錯(cuò)誤日志打印,訪問的時(shí)候返回404,但是部署在Tomcat容器或者使用java -jar 命令是可以成功啟動的,其中spring boot啟動類代碼如下:

import?org.springframework.boot.SpringApplication;
import?org.springframework.boot.autoconfigure.SpringBootApplication;
import?org.springframework.boot.builder.SpringApplicationBuilder;
import?org.springframework.boot.web.support.SpringBootServletInitializer;

@SpringBootApplication
public?class?Application?extends?SpringBootServletInitializer?{

???@Override
???protected?SpringApplicationBuilder?configure(SpringApplicationBuilder?application)?{
??????return?application.sources(Application.class);
???}
???public?static?void?main(String[]?args)?{
??????SpringApplication.run(Application.class,?args);
???}
}

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.example</groupId>
???<artifactId>demo</artifactId>
???<version>0.1.0-SNAPSHOT</version>
???<packaging>war</packaging>

???<name>springboot-security-jwt</name>
???<description>Demo?project?for?Spring?Boot</description>

???<parent>
??????<groupId>org.springframework.boot</groupId>
??????<artifactId>spring-boot-starter-parent</artifactId>
??????<version>1.5.4.RELEASE</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>
?????????<exclusions>
????????????<exclusion>
???????????????<groupId>org.springframework.boot</groupId>
???????????????<artifactId>spring-boot-starter-tomcat</artifactId>
????????????</exclusion>
?????????</exclusions>
??????</dependency>
??????<dependency>
?????????<groupId>org.springframework.boot</groupId>
?????????<artifactId>spring-boot-starter-jetty</artifactId>
??????</dependency>
??????<dependency>
?????????<groupId>org.springframework.boot</groupId>
?????????<artifactId>spring-boot-starter-security</artifactId>
??????</dependency>
??????<dependency>
?????????<groupId>org.springframework.boot</groupId>
?????????<artifactId>spring-boot-starter-data-jpa</artifactId>
??????</dependency>
??????<dependency>
?????????<groupId>org.springframework.boot</groupId>
?????????<artifactId>spring-boot-starter-mobile</artifactId>
??????</dependency>
??????<dependency>
?????????<groupId>mysql</groupId>
?????????<artifactId>mysql-connector-java</artifactId>
??????</dependency>
??????<dependency>
????????????<groupId>io.jsonwebtoken</groupId>
????????????<artifactId>jjwt</artifactId>
????????????<version>0.6.0</version>
????????</dependency>
??????<dependency>
?????????<groupId>joda-time</groupId>
?????????<artifactId>joda-time</artifactId>
??????</dependency>

??????<dependency>
?????????<groupId>com.fasterxml.jackson.core</groupId>
?????????<artifactId>jackson-databind</artifactId>
??????</dependency>
??????<dependency>
?????????<groupId>com.fasterxml.jackson.core</groupId>
?????????<artifactId>jackson-annotations</artifactId>
??????</dependency>

??????<dependency>
?????????<groupId>com.h2database</groupId>
?????????<artifactId>h2</artifactId>
?????????<scope>runtime</scope>
??????</dependency>

????????<dependency>
????????????<groupId>org.springframework.boot</groupId>
????????????<artifactId>spring-boot-devtools</artifactId>
????????????<optional>true</optional>
????????</dependency>

????????<dependency>
??????????<groupId>org.webjars</groupId>
??????????<artifactId>angularjs</artifactId>
??????????<version>1.5.8</version>
????????</dependency>

????????<dependency>
????????????<groupId>org.webjars.bower</groupId>
????????????<artifactId>angular-route</artifactId>
????????????<version>1.5.9</version>
????????</dependency>

????????<dependency>
??????????<groupId>org.webjars</groupId>
??????????<artifactId>bootstrap</artifactId>
??????????<version>3.3.7</version>
????????</dependency>

??????<dependency>
????????????<groupId>org.webjars</groupId>
????????????<artifactId>jquery</artifactId>
????????????<version>2.1.1</version>
????????</dependency>

??????<dependency>
?????????<groupId>org.springframework.boot</groupId>
?????????<artifactId>spring-boot-starter-test</artifactId>
?????????<scope>test</scope>
??????</dependency>

??????<dependency>
?????????<groupId>org.springframework.security</groupId>
?????????<artifactId>spring-security-test</artifactId>
?????????<scope>test</scope>
??????</dependency>
???</dependencies>
???<repositories>
??????<repository>
?????????<id>nexus-aliyun</id>
?????????<name>Nexus?aliyun</name>
?????????<url>http://maven.aliyun.com/nexus/content/groups/public</url>
??????</repository>
???</repositories>

???<build>
??????<finalName>${project.artifactId}</finalName>
??????<plugins>
?????????<plugin>
????????????<groupId>org.springframework.boot</groupId>
????????????<artifactId>spring-boot-maven-plugin</artifactId>
?????????</plugin>
??????</plugins>
???</build>
</project>

我重寫了代碼,問題均能重現(xiàn),初步懷疑是jetty容器的原因,希望能得到老師的解答,

正在回答

1 回答

<dependency>
????<groupId>org.springframework.boot</groupId>

????<artifactId>spring-boot-starter-jetty</artifactId>

????<scope>provided</scope>

</dependency>


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Robot2 提問者

謝謝老師的回答,我打包的時(shí)候把spring-boot-starter-jetty 的scope設(shè)置成provided了,但是還是不能訪問項(xiàng)目,我今天又讓其他同學(xué)重試了一下,遇到了和我一樣的問題,希望老師給解惑
2018-01-31 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

在jetty容器下部署失敗,希望得到老師或者大家的幫助

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號