Upgrading GlassFish 3.1.2.2 to use JPA 2.1

前端 未结 3 1664
醉梦人生
醉梦人生 2020-12-07 00:00

I am working with GlassFish 3.1.2.2 (I can not upgrade to 4 due to OS restrictions).

I\'m interested in upgrading JPA 2.0 to JPA 2.1 GlassFish 3.1.2.2. How can I ac

相关标签:
3条回答
  • 2020-12-07 00:34

    I'm using Hibernate 4.3.8 (requires JPA 2.1) with Glassfish 3.1.2.2.

    Note: I'm not using any services provided by glassfish. All the libraries I use are in the WEB-INF/lib.

    1 - Override all JPA classes (package javax.persistence) in glassfish/modules/javax.persistence.jar with JPA 2.1 version. You should not replace the entire JAR, only override the classes. This JAR has an OSGI manifest and other classes that must remain there.

    2 - Remove all javassist classes (package javasssist) from glassfish/modules/weld-osgi-bundle.jar. This solves a possible incompatibility if you are using Hibernate.

    0 讨论(0)
  • 2020-12-07 00:40

    This is most likely not possible at all. JPA 2.1 is part of EE 7 and therefore not fully integrated with EE 6 GF 3.1.2.2.

    0 讨论(0)
  • 2020-12-07 00:50

    Did you try just replacing the EclipseLink and JPA jar files in Glassfish?

    It will probably work, but if you use managed persistence units they will not expose any JPA 2.1 API, you would need to unwrap the EntiyManager to access these.

    0 讨论(0)
提交回复
热议问题