Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
465 views
in Technique[技术] by (71.8m points)

java - Deploying spring boot on JBOSS EAP 6.1

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...