3

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 (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
Community
  • 1
  • 1
Sodved
  • 8,428
  • 2
  • 31
  • 43
  • Did you check JBoss log file for any errors that might occurred? – Daniel Olszewski May 05 '16 at 05:23
  • There a line or two added when I load the .war, and then a heap of output when I enable it. But no logging when requests are issued. Log is here: http://pastebin.com/uscADLVN You can see it does something with the /greeting mapping – Sodved May 05 '16 at 06:13
  • UPDATE: I have spring working in jboss now, but not with spring boot. It required defining a servelt in the XML files. If I don't get a proper answer, I'll post the various XML I used to do it. – Sodved May 09 '16 at 00:58
  • Hi @Sodved, same issue here and pretty much the same configuration. Would that be possible for you to post an answer with your solution? Thank you – mp_loki May 17 '17 at 14:22

1 Answers1

2

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/

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Sebastien
  • 791
  • 5
  • 6
  • Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. – Armali Feb 07 '19 at 14:43