本文介绍了无法在jBoss EAP 6.3.3上部署Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Tool Suite版本:3.7.0.RELEASE通过tc服务器部署spring boot项目,该项目可以正常运行,但在JBoss EAP 6.1+上无法运行.我得到一个JBWEB000065:HTTP状态404-/shell/

I am using Spring Tool Suite Version: 3.7.0.RELEASE to deploy a spring boot project using tc server which works fine but fails on JBoss EAP 6.1+. I get a JBWEB000065: HTTP Status 404 - /shell/

ShellApplication.java

ShellApplication.java

@SpringBootApplication
@ComponentScan("shell")
public class ShellApplication extends SpringBootServletInitializer {

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(ShellApplication.class);
}

public static void main(String[] args) {
      SpringApplication.run(ShellApplication.class, args);
}
}

src/main/webapp/WEB-INF/jboss-web.xml

src/main/webapp/WEB-INF/jboss-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <context-root>/</context-root>
</jboss-web>

控制台日志

13:41:36,460 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "shell.war" (runtime-name: "shell.war")
13:42:15,089 INFO  [org.jboss.web] (ServerService Thread Pool -- 53) JBAS018210: Register web context: /shell
13:42:17,332 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "shell.war" (runtime-name : "shell.war")

浏览器

JBWEB000065: HTTP Status 404 - /shell/

--------------------------------------------------------------------------------

JBWEB000309: type JBWEB000067: Status report

JBWEB000068: message /shell/

JBWEB000069: description JBWEB000124: The requested resource is not available.

推荐答案

我在JBoss EAP 6.4/spring boot 1.5上遇到了同样的问题,并且解决了将该属性添加到application.properties的问题.

I had the same problem on JBoss EAP 6.4 / spring boot 1.5 and what fixed it was to add this property to application.properties

server.servlet-path=/*

如本文中所述:在JBOSS EAP 6.1上部署spring boot

这篇关于无法在jBoss EAP 6.3.3上部署Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 06:11