1. 程式人生 > >springboot錯誤記錄(一)

springboot錯誤記錄(一)

場景:啟動了一個springboot程式,並且沒有報錯,當我們在瀏覽器 訪問: localhost:prot的時候,會出現404錯誤,因為我們沒有訪問資源。

出現以下錯誤:

並且你的後臺會報錯

Caused by: java.lang.NoClassDefFoundError: org/springframework/expression/spel/support/SimpleEvaluationContext
    at org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$ExpressionResolver.getContext(ErrorMvcAutoConfiguration.java:279)
    at org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$ExpressionResolver.<init>(ErrorMvcAutoConfiguration.java:275)
    at org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$SpelView.render(ErrorMvcAutoConfiguration.java:225)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286)
    at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)

    ... 30 common frames omitted

這是因為沒有引入jar包

           <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-expression</artifactId>
                    <version>4.3.16.RELEASE</version>

        </dependency>

引入就可以了。