我下面的教程link hereorg.xml.sax.SAXParseException; lineNumber:10; columnNumber:18; CVC-複雜type.2.4.a:無效的含量被發現開始元素 '屬性'
和我得到
產生的原因:org.xml.sax中。的SAXParseException; lineNumber:10; columnNumber:18; cvc-complex-type.2.4.a:從元素'properties'開始找到無效的內容。 「{」http://xmlns.jcp.org/xml/ns/persistence「:property}」之一是預期的。
這是指着我presistence.xml看起來如下
:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="loginTestPU" transaction-type="RESOURCE_LOCAL">
<class>entities.User</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/p?zeroDateTimeBehavior=convertToNull"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.user" value="User"/>
<property name="javax.persistence.jdbc.password" value="p"/>
<properties/>
</persistence-unit>
</persistence>
什麼樣的性質,預計?
同樣在視頻中使用了Eclipse_JPA庫,我安裝了netbeans 8.1,並且它使用了EclipseLink(JPA2.1)。這只是我的實施和這個視頻的區別。
使用''代替' ' –
好了現在我得到了不同的錯誤,這是好的現在的' '是由netbeans自動生成什麼是與前斜線之前或之後的屬性差異? –
' '不過是短暫的' '但是,如果你想添加 '你在你的情況做之間'東西,你不能使用' ' –