根据documentation,我正在运行WebLogic Server版本12.2.1.3.0,它支持JPA 2.1。
对于JPA 2.0,我成功用persistence.xml部署了同一项目,但是在2.1版中收到了此错误。
Caused by: com.bea.xml.XmlException: failed to load java type corresponding to
persistence.xml的内容:
<persistence xmlns="http://java.sun.com/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"
version="2.1">
<persistence-unit name="flow" transaction-type="JTA">
<description>poc desc</description>
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>requestDS</jta-data-source>
</persistence-unit>
也许无关,我注意到了以下警告
<Warning> <JAXRSIntegration> <wlp-server> <AdminServer> <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <27bbca51-7e2d-43fc-b9ca-f103dde5eeb8-00000016> <1566911950609> <[severity-value: 16] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-2192511> <The list of resource packages: org.eclipse.persistence.jpa.rs.resources;org.eclipse.persistence.jpa.rs.resources.unversioned;org.eclipse.persistence.jpa.rs.exceptions>e=persistence@http://java.sun.com/xml/ns/persistence
此外,我读了一篇类似问题的文章,说服务器无法获得persistence_2_1.xsd,因此我在startWeblogic.sh的JAVA_OPTIONS中添加了HTTP。*和https。*代理设置。这没有什么区别,并且服务器日志中没有任何有关是否成功检索文件的信息。