springboot packaged into a jar can not run server

This is the case, the application used springboot to do in the local eclipse, idea can run up and functioning, packaged into war package, thrown inside tomcat server, it can be run properly. But packaged into a jar package, running on the server: java -jar xxx.jar, start no problem, but access error: SpringBoot Whitelabel Error Page

The solution according to the Internet:

  • 1. not visit the page, probably jsp files are not packed into it, but no, the problem is not solved
            <resource>   
                <directory>src/main/webapp</directory>  
                <targetPath>META-INF/resources</targetPath>  
                <includes>  
                    <include>**/**</include>  
                </includes>  
            </resource>  
            <resource>  
                <directory>src/main/resources</directory>  
                <includes>  
                    <include>**/**</include>  
                </includes>  
                <filtering>false</filtering>  
            </resource>  
        </resources>  
  • Question 2. project directory, package startup class where the other classes must be in before one, did not solve

  • 3. Developer Packaging caused in the root directory of the project, using the command line mvn claen package, did not solve the problem

  • 4.springBoot version of the problem, modify 1.4.2.RELEASE, problem solved! (Tried several versions will not work, except 1.4.2 can, for unknown reasons)

Guess you like

Origin blog.csdn.net/change_on/article/details/92087283