[英]Deploying spring boot on JBOSS EAP 6.1
I am trying to deploy a jar on Jboss 6.1 EA. 我正在尝试在Jboss 6.1 EA上部署一个jar。 I had build the jar file.
我已经构建了jar文件。
I am unable to access the page http://localhost:8080/$YOURAPP/hello/World
, because I get a 404 error. 我无法访问页面
http://localhost:8080/$YOURAPP/hello/World
,因为我收到404错误。 I replaced the $YOURAPP
with the name of the war file. 我将
$YOURAPP
替换为war文件的名称。 I do not get any errors while starting jboss, it shows the war is getting deployed. 我在启动jboss时没有遇到任何错误,它表明战争正在部署。
You will definitely need a .war
file for JBoss because a (fat) .jar
file will not work. 你肯定需要JBoss的
.war
文件,因为(胖) .jar
文件不起作用。 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. 对于JBoss,您还需要
src/main/webapp/WEB-INF
文件中的jboss-web.xml
描述符文件,其中包含应用程序的上下文根。
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: 之后,您需要再设置一个Spring Boot属性,以便在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. 这是由于JBoss本身的一个怪癖,如果你没有将这个属性设置为
/*
它将无法工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.