Search code examples
jerseyglassfisheclipselink

How to find what version of EclipseLink my Eclipse Project is using?


I have a Maven jersey-quickstart-webapp Project I am developing in Eclipse. The project is a JERSEY REST backend with angularjs javascript frontend.

I would like to know how to check what version of EclipseLink my project is using.

Where can I find this property? I've searched high and low but I can't find it - I know that I did stumble across it before, so it definitely exists....

This question is trying to get to the bottom of the following question I posed months ago about a problem with eclipselink and Jersey REST, that still hasn't been fixed: Class not found when using JAX-RS with Eclipse and Glassfish This should be fixed with jersey 2.22.1 and eclipselink 2.6.1, but I think somewhere in my setup, eclipselink 2.6.0 is still hanging around and screwing the whole thing up. Highly frustrating!

I know that eclipselink is being used in this project, because the following code returns 2.6.1 when the project is running. However, previously I saw that even though this was saying 2.6.1, that the eclipselink configuration somewhere(I can't remember where - doh!) was still saying version 2.6.0.

//This helps us tell what version of eclipse link we are using
Class<?> myClass = Class.forName("org.eclipse.persistence.Version");
Method myMethod = myClass.getMethod("getVersion");
String version = myMethod.invoke(null).toString();
System.out.println("version = " + version);

Here is what the Maven dependency hierarchy looks like - as you can see it has no eclipselink stuff in there: Maven dependency hierarchy

All help highly appreciated...


Solution

  • The eclipselink you're running is provided by the Glassfish server. Look in the glassfish/modules directory and find the org.eclipse.persistence.core.jar file. Inside it will be a readme.html. Open that and the version of eclipselink that is installed in Glassfish will be there.

    Mine says, for glassfish 4 (somewhat old) is:

    <B>EclipseLink 2.5 Read Me</B>