在 JBOSS EAP 6.1 上部署 Spring Boot [英] Deploying spring boot on JBOSS EAP 6.1
问题描述
我正在尝试在 Jboss 6.1 EA 上部署一个 jar.我已经构建了 jar 文件.
我无法访问页面 http://localhost:8080/$YOURAPP/hello/World
,因为我收到 404 错误.我将 $YOURAPP
替换为 war 文件的名称.启动 jboss 时我没有收到任何错误,这表明战争正在部署.
您肯定需要一个用于 JBoss 的 .war
文件,因为(胖).jar
文件将不行.对于 JBoss,您还需要 src/main/webapp/WEB-INF
文件中包含应用程序上下文根的 jboss-web.xml
描述符文件.>
例如:
<context-root>YOUR_APP_ROOT</context-root></jboss-web>
在那之后,您将需要再设置一个 Spring Boot 属性以使其在 JBoss EAP 6 上工作:
server.servlet-path =/*
这是由于 JBoss 本身的一个怪癖,如果您没有将此属性设置为 /*
它将不起作用.
I am trying to deploy a jar on Jboss 6.1 EA. I had build the jar file.
I am unable to access the page http://localhost:8080/$YOURAPP/hello/World
, because I get a 404 error. I replaced the $YOURAPP
with the name of the war file. I do not get any errors while starting jboss, it shows the war is getting deployed.
You will definitely need a .war
file for JBoss because a (fat) .jar
file will not work.
For JBoss, you will also need a jboss-web.xml
descriptor file in src/main/webapp/WEB-INF
file containing the context root of your application.
For example:
<jboss-web>
<context-root>YOUR_APP_ROOT</context-root>
</jboss-web>
After that, you will need to set one more Spring Boot property to make this work on JBoss EAP 6:
server.servlet-path = /*
This is due to a quirk in JBoss itself, if you don't have this property set to /*
it will not work.
More information here and here
这篇关于在 JBOSS EAP 6.1 上部署 Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!