JSTL下NoClassDefFoundError : javax/servlet/jsp/jstl/core/Config錯誤,

來源:互聯網
上載者:User

JSTL下NoClassDefFoundError : javax/servlet/jsp/jstl/core/Config錯誤,

使用springmvc時,項目啟動後發送請求報錯

Type Exception ReportMessage Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/ConfigDescription The server encountered an unexpected condition that prevented it from fulfilling the request.Exceptionorg.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:986)    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)    javax.servlet.http.HttpServlet.service(HttpServlet.java:635)    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)Root Causejava.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

在項目中我明明已經匯入了JSTLjar包了。

網上說的有些版本即便你引入jstl1.2的包,uri處仍舊報錯找不到標籤。此時,我們還再引入standard包即可。但是也用maven引入了,依舊報錯。

重新查詢資料發現還可能Jar 包衝突了,這是日常開發過程中,時常會遇到的問題。於是就解決由 jstl 的 Maven 依賴導致的 Jar 包衝突問題

<dependency>            <groupId>javax.servlet.jsp.jstl</groupId>            <artifactId>jstl-api</artifactId>            <version>1.2</version>            <exclusions>                <exclusion>                    <groupId>javax.servlet</groupId>                    <artifactId>servlet-api</artifactId>                </exclusion>                <exclusion>                    <groupId>javax.servlet.jsp</groupId>                    <artifactId>jsp-api</artifactId>                </exclusion>            </exclusions>        </dependency>        <dependency>            <groupId>taglibs</groupId>            <artifactId>standard</artifactId>            <version>1.1.2</version>        </dependency>

不幸的是,結果圖依舊是這個殘忍的500

然後就開始了debug行動。經過漫長的測試後發現在DispatherServelt中報錯了。。

可以看到是調用了modelview的時候出錯,找不到視圖了。。再看springmvc的配置,用到了JSTLView,於是做個測試,刪掉這個試圖後就可以訪問了

但是我對於國際化等需要這個視圖解析器啊,,於是不服氣,繼續找原因。。。最後!!!終於發現了,,在target下的lib下jar包確實沒有新加進去的兩個jar包!!!!!好吧,,被自己蠢哭了,,

加進去後重新啟動就OK了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.