0

I have an app that runs properly when I execute java -jar myapp.jar but when I link it to run as process I'm getting 404 error. So I made an gitHub repository only with the relevant classes to show you the error. Could you try to reproduce it?

Here is the code https://github.com/alephlm/spring-boot-1.3-error-executable-service

I'm using ubuntu 14.04

Thanks.

Yevhen Surovskyi
  • 931
  • 11
  • 19
Aleph
  • 66
  • 5
  • I suspect this is a variant of http://stackoverflow.com/questions/37206862/is-it-possible-with-spring-boot-to-serve-up-jsps-with-a-stand-alone-jar-packagin/37211666#37211666 – Andy Wilkinson May 15 '16 at 17:41

1 Answers1

0

Your maven script never explicitly packages the webapp contents, and even if it did, Tomcat will not pick it up. But, there is a work around, do the following:

  • create a META-INF/resources in your resources folder (e.g. src/main/resources/META-INF/resources/)
  • now move everything from under webapp to your new META-INF/resources folder (e.g. ..META-INF/resources/WEB-INF/views/hello.jsp)

I recently read about it on Gunnar's blog. The great thing about this solution is that you don't have to mess with the maven copying resources, it will automatically get picked up since it's in src/main/resources.

ikumen
  • 11,275
  • 4
  • 41
  • 41