jpa报错Invalid persistence.xml. Error parsing XML (line-1 : column -1): cvc-elt.1: 找不到元素 'persistence'

学习jpa时,运行报错

通过网上查找原因,发现的jpa版本和jar架包的原因

换成2.0就好了

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0">

猜你喜欢

转载自blog.csdn.net/Yang_g_/article/details/81043584