0

I have problem, i make Spring Boot app and i have bigger problem with deploy it than write it. So, when i start my app manualy from IDE STS, app work fine, but when i pack it to .jar and try run it from CMD with command java -jar appname.jar . Application run but when i want to visit any page, i get error 404.

I think it is some problem with package process. When i run project from cmd and i try to enter on any site ( http : //localhost:8080/answers for example) in CMD i get new line with SQL request... so Controllers are ok, application cant see .jsp files. in application.properties i have :

spring.mvc.view.prefix= /WEB-INF/views/

spring.mvc.view.suffix= .jsp

I have all needed dependencies in my POM : [https://pastebin.com/c0hqwYT8][1]

My application.class is like tutorials : [https://pastebin.com/yHscwEm0][1]

My project structure : [http://imgur.com/a/LEciD][1] [http://imgur.com/a/LvaWc][1]

VNT
  • 934
  • 2
  • 8
  • 19
Daxter44
  • 115
  • 12
  • try to add to your application.properties `server.context-path="mypath"` and then access it from \mypath – fg78nc Jun 16 '17 at 16:17
  • If you are building a web application containing pages then the file should be a `war` file. – kk. Jun 16 '17 at 16:19
  • @KrishnaKuntala Not neccessary, it could be executable jar(for spring boot) – fg78nc Jun 16 '17 at 16:21
  • its looks like jar file ddont have jsp files ... i have folders like BOOT-INF META-INF org in boot-inf i have classes and lib in meta-inf i havve folder maven with POM and manifest – Daxter44 Jun 16 '17 at 16:53

1 Answers1

1

I HAVE IT ! I must put my views to /src/main/resources/META-INF/resources/WEB-INF/ Path like in this tutorial : https://dzone.com/articles/spring-boot-with-jsps-in-executable-jars-1

Daxter44
  • 115
  • 12