我正在使用jersey.I部署一个restful,我正在阅读本教程并执行说明:http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/RESTfulWebServices/RESTfulWebservices.htm
但我在服务器上部署时遇到了这个错误。
严重:在归档类中部署应用程序PlayerServer2 : org.xml.sax.SAXParseException;lineNumber: 5;columnNumber: 15;部署描述符文件META/sistence.xml时出现异常。2.4.b:元素'persistence‘的内容不完整。{“http://xmlns.jcp.org/xml/ns/persistence”:persistence-unit}之一是预期的。
我使用netbean 8.0.1,glassfish服务器4.1,JDK 1.8.91,JPA 2.1
编辑:
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://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="PlayerServer2PU" transaction-type="JTA">
<jta-data-source>jdbc/playerdb2</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties/>
</persistence-unit>
</persistence>发布于 2016-07-18 08:11:35
请删除空的<properties/>标记,以便正确处理persistence.xml文件。
https://stackoverflow.com/questions/38426317
复制相似问题