1. 程式人生 > >Unable to validate using XSD: Your JAXP provider does not support XML Schema

Unable to validate using XSD: Your JAXP provider does not support XML Schema

今天在maven工具構建一個java web(暫時只用到tomcat+spring)的工程時,遇到了幾個小問題,由於以前也碰到過,所以想記錄一下,以備未來查閱:
(A)tomcat啟動的時候報這個錯,貌似是不能解析xml檔案,然後到網上找了一下解答

org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from URL [file:/E:/hefei_spring_mybatis_mvc/.metadata/.plugins/org.eclipse
.wst.server.core/tmp0/wtpwebapps/spring_chapter05/WEB-INF/classes/beans.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [[email protected]] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:406) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader
.loadBeanDefinitions(XmlBeanDefinitionReader.java:304) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@40f52e28] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support. at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:102) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:71) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:429) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:391) ... 22 more Caused by: java.lang.IllegalArgumentException: http://java.sun.com/xml/jaxp/properties/schemaLanguage at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setAttribute(DocumentBuilderFactoryImpl.java:118) at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:99) ... 25 more

解決方法如下:
(1)雙擊tomcat跳出如下介面,點選open launch configuration,如下圖
這裡寫圖片描述
(2)然後在Arguments選項卡的VM argument中的框中複製如下引數,儲存並重新執行:
這裡寫圖片描述

-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl

(B)還有一個問題是我經常犯得問題,就是maven工程的pom.xml明明寫了相關jar的依賴,但是在web工程啟動的時候報找不到相關類的錯誤(專案背景是在maven下構建web工程的時候),這個時候檢視工作區下的相應工程的/WEB-INF/lib路徑下,並沒有相關的jar包

解決方法如下:

  • 右鍵點選專案選擇Properties選擇Deployment Assembly,在右邊點選Add按鈕,在彈出的視窗中選擇Java Build Path Entries
    這裡寫圖片描述
  • 點選Next,選擇Maven Dependencies
  • 點選Finish,然後可以看到已經把Maven Dependencies新增到Web應用結構中了

(c)最後一個問題就是,在解決maven工程上有紅叉的時候解決思路,點選Window–>show veiw–>Markers),檢視錯誤的詳細資訊,可以檢視一下錯誤的原因。
markers檢視

相關推薦

Unable to validate using XSD: Your JAXP provider does not support XML Schema

今天在maven工具構建一個java web(暫時只用到tomcat+spring)的工程時,遇到了幾個小問題,由於以前也碰到過,所以想記錄一下,以備未來查閱: (A)tomcat啟動的時候報這個錯,貌似是不能解析xml檔案,然後到網上找了一下解答 org.

Unable to validate using XSD: Your JAXP provider []

2009-02-21 08:42:53,312 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from Servlet

Spring-XML配置-Tomcat -Unable to validate using XSD ... JFreeChart

2009-02-21 08:42:53,312 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from ServletCo

Avoid "Unable to validate the following destination configurations" When Using S3 Event Notifications

{ "Parameters": { "paramBucketName": { "Type": "String", "Description": "Bucket Name" } }, "Resources": { "SNSTopi

redis:java.util.NoSuchElementException: Unable to validate object

cnblogs exception 127.0.0.1 集群 發布 ping通 component redis集群 date redis.clients.jedis.exceptions.JedisException: Could not get a resource f

redis:Unable to validate object ;Could not get a resource from the pool;(error) MISCONF Redis is con

原因: 強制關閉Redis快照導致不能持久化。 解決方式: 登入redis : redis-cli 127.0.0.1:6379>config set stop-writes-on-bgsave-error no ok 解決 ! 參考文章:

C#連線Mongo報Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1錯的解決方案

---恢復內容開始--- 最近做一個基於ABP的.net Core的專案,資料庫選了MongoDB,但是返現無法給資料庫設定認證,只要設定了賬號密碼連線就報錯 連線串如下: mongodb://root:[email protected]/Webdev 已經給了root使用者"__syste

Eclipse4.6安裝Tomcat插件時報錯:Unable to read repository at http://tomcatplugin.sf.net/update/content.xml. Received fatal alert: handshake_failure

logs tomcat repos cef blog 時報 技術分享 src tom 錯誤如下: Unable to read repository at http://tomcatplugin.sf.net/update/content.xml.Received fat

Error:Unable to make the module:***, related gradle configuration was not found. Please, re-import the Gradle project and try again.

RR ble err alt conf related error: found ref 打開idea的 View -> Tool Windows -> Gradle.然後點擊 Refresh Error:Unable to make the mod

uwsgi啟動Django項目時:unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode ***

site not wsgi div auto mode bsp ini 準備 說起來有點坑 用命令都能正常啟動,但是用配置文件就是不行 提示 unable to load app 0 (mountpoint=‘‘) (callable not found or i

uwsgi啟動Django專案時:unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode ***

說起來有點坑 用命令都能正常啟動,但是用配置檔案就是不行 提示 unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic m

centos7下 VMware Workstation虛擬機器報錯 Unable to open .vmx as a Virtual Machine: File not found

1.問題描述 VMware Workstation虛擬機器報錯"無法開啟.VMX作為虛擬機器:檔案未找到",意思是虛擬機器無法開啟檔案,造成虛擬機器中安裝的Windows系統或其它系統無法開啟。 2.出錯原因 虛擬機器中所安裝系統的檔案放在了分盤中,如下圖的“2.0TB卷”

Your development team, "", does not support the Push Notifications capability.

找到 abi 解決 運行 文件中 cati devel xxx 解決方法 問題: Your development team, "", does not support the Push Notifications capability. 解決方法: 1.找到工程文件中

Resolve "The provided key element does not match the schema" Error When Importing DynamoDB Tables Using Hive on Amazon EMR

2018-02-01 08:17:27,782 [INFO] [TezChild] |s3n.S3NativeFileSystem|: Opening 's3://bucket/folder/ddb_hive.sql' for reading 2018-02-01 08:17:27,81

DateConverter does not support default String to 'Date' conversion

原因:使用request獲取date日期時,beanutils不能將String轉換成Date 1.將bean裡面的Date型別轉換為java.sql.Date; 2.自己註冊一個轉換器

Eclipse報錯:Referenced classpath provider does not exist: org.maven.ide.eclipse……

Shell程式碼   Referenced classpath provider does not exist: org.maven.ide.eclipse.launchconfig.classpathProvider    截圖如下: 引起這個錯誤的原因主要是新的m2e外掛的namespa

Endeca Install Problem ‘JDBC driver does not support XA, hence cannot be a participant in to-phase c

If like me you’ve downloaded Endeca 3.1 and want to try all the extra goodies that have been added. One of the first things I wanted t

Norton Antivirus 2005 does not support to Repair feature的錯誤解決

今天Norton Antivirus 2005忽然不知道怎麼搞得,只要一開啟Word文件,就蹦出標題上說的錯誤,而且還跳出來個Installer,不知搞什麼鬼。Google了一下,發現是我昨天清理開始選單中的快捷方式造成

hadoop WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

for bsp native del code warn you port uil 這個waring 信息是可以忽略的。下面是解決方案 在hadoop-env.sh中添加 export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.p

連接池報錯 Proxool Provider unable to load JAXP configurator file: proxool.xml

mage 最大連接數 代碼片段 大連 解決方案 自己 onf 去掉 current 上篇博文講到簡易配置 proxool 連接池:http://www.cnblogs.com/linnuo/p/7232380.html 由於把說明註釋留在了 proxool.xml 配置文