1. 程式人生 > >cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-pattern'. One of

cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-pattern'. One of

報錯提示是:cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-pattern'. One of 
 '{"http://java.sun.com/xml/ns/javaee":url-pattern}' is expected.

發現這個問題然後百度,在csdn上看到一遍轉載文章,說是將將“http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd”這段話加入到xml檔案的"xmlns:xsi="的標籤中,

的確,

沒有報錯了,可是問題還是沒有解決,tomcat執行時還是出錯,404錯誤,找不到路徑,後面發現竟然是把<url-pattern>錯寫成了

<servlet-pattern>。- -!