1

I did following tutorial link here

and I am getting

Caused by: org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 18; cvc-complex-type.2.4.a: Invalid content was found starting with element 'properties'. One of '{"http://xmlns.jcp.org/xml/ns/persistence":property}' is expected.

which is pointing to my presistence.xml which looks as follow:

<?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>

What kind of property is expected?

Also on video the Eclipse_JPA library was used, I have netbeans 8.1 installed and it doest have this library I have used EclipseLink(JPA2.1) instead. This is only difference between my implementation and this one on video.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
John Doe
  • 13
  • 3

1 Answers1

0

Use </properties> in place of <properties/>

<properties/> is nothing but a short of <properties/> <properties/> But if you want to add something between <properties/> <properties/> which you trying to do in your case you cannot use <properties/>

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202