How to change EclipseLink in GlashFish 4.0?

久未见 提交于 2019-12-07 01:52:19

问题


I want to change EclipseLink from 2.5.0 to 2.5.1 in GlashFish 4.0. I have downloaded the OSGi bundle and replaced the following jar files

  1. org.eclipse.persistence.antlr.jar
  2. org.eclipse.persistence.jpa.jar
  3. org.eclipse.persistence.asm.jar
  4. org.eclipse.persistence.jpa.modelgen.jar
  5. org.eclipse.persistence.core.jar
  6. org.eclipse.persistence.oracle.jar
  7. javax.persistence.jar

under $GLASSFISH_HOME/glassfish/modules.


After doing this, the version still remains the same. The following code,

String version = org.eclipse.persistence.Version.getVersion();
System.out.println("EclipseLink version : " + version);

still displays the version 2.5.0.


The bundle contains no eclipselink-x.x.x.jar.

What else is required to be changed? I'm using NetBeans 7.2.1.


回答1:


You forgot some files, you need the complete list:

  1. org.eclipse.persistence.antlr.jar
  2. org.eclipse.persistence.asm.jar
  3. org.eclipse.persistence.core.jar
  4. org.eclipse.persistence.dbws.jar
  5. org.eclipse.persistence.jpa.jpql.jar
  6. org.eclipse.persistence.jpa.jar
  7. org.eclipse.persistence.jpa.modelgen.jar
  8. org.eclipse.persistence.moxy.jar
  9. org.eclipse.persistence.oracle.jar
  10. javax.persistence.jar

You don't have to rename the files, you can delete the old files starting with org.eclipse and copy the required files to the modules folder. This should do the trick.

Update: If it doesn't work you may have to clear the OSGI cache. To do this shutdown the server and delete the folder felix in

$GLASSFISH_HOME/glassfish/domains/domain/osgi-cache/

Restart the server and wait a moment, it'll have to read the OSGI module information to rebuild the cache.



来源:https://stackoverflow.com/questions/22920319/how-to-change-eclipselink-in-glashfish-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!