Hibernate version?
I'm using JBoss Embedded version beta3.SP10 and I'm facing a persistence bug that is should be fixed in some Hibernate ve开发者_开发百科rsion. Sadly, I don't know what version of Hibernate is used in my JBoss Embedded and couldn't find a way to find this information, the hibernate-all.jar
bundled in it doesn't contain a org.hibernate.Version
class, nor a MANIFEST.
How can I find the currently loaded Hibernate version without using org.hibernate.Version
?
Try this,
System.out.println(org.hibernate.Version.getVersionString());
found here
Another way to obtain the version.
System.out.println(org.hibernate.cfg.Environment.VERSION)
This is for older version of Hibernate. e.g. 3.3.1.GA
This simple Java code is get the Hibernate version.
package com.test;
public class TestBean {
public static void main(String[] args) {
try {
String hibernateVersion = org.hibernate.annotations.common.Version.VERSION;
System.out.println("Hibernate Version: "+ hibernateVersion);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Output: Hibernate Version: 3.1.0.GA
Indeed, it seems hard to find what exact versions of Hibernate modules are used. Some suggestions:
Check if your Hibernate JAR has aIt looks like the JBoss folks were using Ant at this time and the Manifest doesn't provide the version.META-INF/MANIFEST.MF
with the version in it.Dig the JBoss Embedded SVN to find out what they're doing exactly.
Try with JBoss embedded beta3.SP12 (that you can get from the Maven repository).
Try to replace the hibernate-all with a bundle containing Hibernate EM 3.4.0.GA.
I would give options 3 and 4 a try.
I prefer the way of @Shell, not that of @pudaykiran. Actually, I found these two way get different input in my case. As said @pudaykiran, I got:
3.2.0 Final
And as @Shell said:
3.5.4 Final
I guess the 3.5.4 final version used org.hibernate.annotations.common
of previous version. Correct me if I am wrong.
精彩评论