How to find which version of EclipseLink my Eclipse project is using?

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

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

Where can I find this property? I was looking for high and low, but I can’t find it - I know that I came across it before, so it definitely exists ....

This question is trying to figure out the next question that I asked a few months ago about the problem with eclipselink and Jersey REST, which has not yet been fixed: The class was 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 and spinning it all. Very frustrating!

I know that eclipselink is used in this project because the following code returns 2.6.1 when the project is running. However, I saw earlier that although it said 2.6.1, somewhere in the Eclipelink configuration (I can't remember where - doh!) Version 2.6.0 still spoke.

//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); 

This is what the Maven dependency hierarchy looks like - since you can see that it does not have eclipses: Maven dependency hierarchy

All help is much appreciated ...

0
source share
2 answers

The eclipse you are using is provided by the Glassfish server. Look in the glassfish / modules directory and find the org.eclipse.persistence.core.jar file. Inside will be readme.html. Open it and the eclipselink version installed in Glassfish will be there.

Mine says for glass fish 4 (somewhat old):

 <B>EclipseLink 2.5 Read Me</B> 
+1
source

Dubbed! Refer to this question

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

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

Source: https://habr.com/ru/post/1233715/


All Articles