I am trying to deploy a spring .war
into jboss but am getting 404 errors. I know this has been asked before:
- springBoot application on Jboss EAP, servlet context not lodaed
- Spring Java Config vs Jboss 7
- Cannot deploy Spring Boot on jBoss EAP 6.3.3
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.
- pom.xml http://pastebin.com/BiLWDskd
- Application.java http://pastebin.com/par7rftz
I then mvn clean package
and load the resulting .war file into EAP using the UI (https://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 (https://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