我在使用休眠元模型生成器时遇到问题:
java: Error unmarshalling /META-INF/persistence.xml with exception :
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 103; cvc-elt.1: Cannot find the declaration of element 'persistence'.]
这是我的persistence.xml:
<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://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="wespital" transaction-type="JTA">
<jta-data-source>jdbc/wespital</jta-data-source>
</persistence-unit>
</persistence>
当前版本(1.2.Final)似乎不支持 JPA 2.1,而且我在 git 存储库中没有找到该生成器的任何 beta 版本。还有哪些其他选项可以生成元模型类?我使用wildfly作为应用服务器。