我正在尝试集成我在 Liberty Profile 16.0.0.4 中运行的应用程序,但我在使用 JPA 2.1 时遇到了问题。
我使用 Hibernate 5.1.0.Final 实体管理器(以使用 JPA 2.1 功能),它似乎不适用于 WLP 16.0.0.4。我已经尝试将类加载器设置为“最后一个父”但没有效果。以下是供您引用的错误。
下面是尝试创建 EntityManager 时返回的错误。
CWWKZ0002E: An exception occurred while starting the application . The exception message was: com.ibm.ws.container.service.state.StateChangeException: javax.xml.stream.FactoryConfigurationError: Provider javax.xml.stream.XMLEventFactory could not be instantiated: java.util.ServiceConfigurationError: javax.xml.stream.XMLEventFactory: Provider com.ibm.xml.xlxp2.api.stax.XMLEventFactoryImpl not found.
感谢您在这方面的帮助。
最佳答案
如果您使用 liberty 的 Oracle JRE,请尝试将其添加到 liberty 的 jvm.options 文件中:
-Djavax.xml.stream.XMLEventFactory=com.sun.xml.internal.stream.events.XMLEventFactoryImpl
关于hibernate - JPA 2.1 与 Liberty Profile 16.0.0.4 的集成问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42192813/