2013年1月27日 星期日

Cannot find the declaration of element 'jdoconfig' when using JDO/JPA 使用 JPA/JPO 時出現錯誤





Issue: when you  using JPA/JPO, Eclipse display error:
問題: 在 Eclipse 使用 JPA/JPO 時,出現錯誤:

"Description Resource Path Location Type
cvc-elt.1: Cannot find the declaration of element 'jdoconfig'."

Referenced file contains errors (http://java.sun.com/xml/ns/jdo/jdoconfig).  For more information, right click on the message in the Problems View and select "Show Details..."   








Solution 解決方式:


Step 1. edit /src/META-INF/jdoconfig.xml, replace the line with xsi description.
步驟 1. 編輯 /src/META-INF/jdoconfig.xml,將 xsi 宣告的地方做更改

xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig
=>
xsi:SchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">





Reference 參考:

Validating jdoconfig with incorrect url

1 則留言: