简体   繁体   中英

Springboot 1.3.3 gives 404 in Jboss EAP 6.4.0GA

I am trying to deploy a spring .war into jboss but am getting 404 errors. I know this has been asked before:

But I am very new (this week) to maven/spring/jboss, so may well have messed up. I tried what I understood from the various solutions above and none of them worked for me. Probably me messing up or missing something. So I thought I'd get the problem as simple as I can.

I took the code from: https://github.com/spring-guides/gs-rest-service.git And then work in the complete folder.

cd complete 
mvn package
java -jar .\target\gs-rest-service-0.1.0.jar

And that all worked as you'd expect.

So then I followed the instructions here ( http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file ) to modify my code and pom.xml to produce a war file.

I then mvn clean package and load the resulting .war file into EAP using the UI ( http://i.stack.imgur.com/N7zxG.png ).

So then in theory this should be the URL right

I also tried

But am getting the 404 error ( http://i.stack.imgur.com/T6J6z.png ) as described in the other questions. Nothing appears in the jboss console log at all after the .war is loaded.

So am I missing something? Do I need to write a jboss @WebServelet class to wrap around the spring stuff? Changes to my pom.xml? Should I not be using springboot, and just just pring framework modules directly? I note that in the EAP screen it does not show the class in the third column like it did with the jboss sample .war .

Remember I am new to this, so please explain stuff as if I'm a complete dummy (which I am).

Details of my setup:

  • OS Windows7 x64
  • java version "1.8.0_91"
  • Apache Maven 3.3.9
  • Springboot 1.3.3
  • JBOSS EAP 6.4.0
  • No IDE, using vim and command line

I encountered 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=/*

as explained in this post : Deploying spring boot on JBOSS EAP 6.1

A simple tutorial you can follow (though he miswrote the property server.servlet.path ) http://code-adda.com/2018/06/how-to-deploy-spring-boot-war-in-jboss/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM