如何将 javax/persistence/spi/PersistenceUnitInfo.getValidationMode() 与 WAS 6.1 一起使用
我在我的项目中使用 JPA 2.0 和 Spring 和 hibernate。
但是,运行时是 WAS 6.1。
编译一切顺利。
但是,在部署应用程序期间,我收到以下错误:
com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.NoSuchMethodError: javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
在使用 ctrl + shift + T 搜索 PersistenceUnitInfo 类时,我发现它位于以下 jar 中:
\IBM\SDP\runtimes\base_v61\lib\j2ee.jar
并且
\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final
我从 JARS 中提取了上面的类,并使用 JAD 反编译它们比较。
我发现方法 getValidationMode() 不存在于 j2ee.jar 中,但存在于 hibernate-jpa jar 中。
这是我收到错误的原因吗??? 怎么解决呢??我如何告诉 websphere 在 hibernate jar 中查找类而不是在服务器运行时 lib 中查找类???
I am using JPA 2.0 with Spring and hibernate in my project.
However, the runtime is WAS 6.1.
Compilation goes fine.
However, during deployment of the application, I get the following error:
com.ibm.ws.exception.RuntimeError: java.lang.RuntimeException: java.lang.NoSuchMethodError: javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
On searching for PersistenceUnitInfo class using ctrl + shift + T, I found it located in the following jars:
\IBM\SDP\runtimes\base_v61\lib\j2ee.jar
and
\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final
I extracted above class from both the JARS and decompiled them using JAD for comparison.
I found that method getValidationMode() is not present in j2ee.jar but is present in the hibernate-jpa jar.
Is this the reason for the error I am getting ???
How to resolve it ?? How can I tell websphere to look for the class in the hibernate jar and not in server runtime lib ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无论您做什么,都无法将 JPA 2.0 与 Websphere 6.1 一起使用。正如您所注意到的,它非常深入地连接到 WAS 内部。您有两个选择:
You cannot use JPA 2.0 with Websphere 6.1, no matter what you do. As you noticed, it's wired up into the WAS internals pretty deeply. You have two options: