Tom O'Brien
Tom O'Brien

Reputation: 1831

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...

Upvotes: 2

Views: 2772

Answers (2)

Gaurav Gharat
Gaurav Gharat

Reputation: 2101

Duplicated! Refer this

There is a static class and static method to get this information. Example: How to print in java code

AbstractSessionLog.getLog().log(SessionLog.INFO, DatabaseLogin.getVersion());

Upvotes: 2

K.Nicholas
K.Nicholas

Reputation: 11561

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>

Upvotes: 2

Related Questions