Dear Experts,
We have hibernate applications with old lib, the libs were built by java 1.1 to java 1.5. for example, hibernate3.jar is build by java 1.4 (major version 48). I am trying to upgrade it to java 1.8. I load the lib:
geolatte-geom-1.3.0.jar
jandex-2.0.3.Final.jar javassist-3.22.0-GA.jar
byte-buddy-1.8.12.jar org.osgi.core-4.3.1.jar
postgresql-42.2.2.jar commons-collections4-4.2.jar
commons-lang3-3.7.jar javax.interceptor-api-1.2.jar
log4j-core-2.23.1.jar javax.persistence-api-2.2.jar
log4j-api-2.23.1.jar jboss-logging-3.3.2.Final.jar
classmate-1.3.4.jar org.osgi.compendium-4.3.1.jar
jts-core-1.14.0.jar hibernate-c3p0-5.3.1.Final.jar
slf4j-api-1.6.1.jar hibernate-core-5.3.1.Final.jar
ojdbc8-19.3.0.0.jar hibernate-osgi-5.3.1.Final.jar
java-mail-1.4.4.jar mchange-commons-java-0.2.11.jar
proxool-0.8.3.jar hibernate-envers-5.3.1.Final.jar
junique-1.0.4.jar hibernate-proxool-5.3.1.Final.jar
c3p0-0.9.5.2.jar hibernate-spatial-5.3.1.Final.jar
junit5-4.6.7.jar hibernate-jpamodelgen-5.3.1.Final.jar
antlr-2.7.7.jar hibernate-annotations-3.5.6-Final.jar
dom4j-1.6.1.jar hibernate-commons-annotations-5.0.3.Final.jar
log4j-3.1.2.jar jboss-transaction-api_1.2_spec-1.1.1.Final.jar
Based on existed hbm.xml files, did some modification, and not changed java mapping class,
The hibernate.cfg.xml list all the hbm.xml files, not mentioned the class. the header of the hbm.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Configuration DTD 5.3//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-5.3.dtd" >
....
I put the hibernate.cfg.xml under \src,
in a class:
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
... ....
AnnotationConfiguration config = new AnnotationConfiguration().configure();
the line above caused error:
java.lang.NoClassDefFoundError: org/hibernate/cfg/Mappings
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Mappings
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 26 more
There is one seen problem. if put http://hibernate.sourceforge.net/hibernate-mapping-5.3.dtd in Chrome, I get 404 error. if change to 3.0.dtd, Chrome has no 404 error, but my application get the same error.
I am working on eclipse, oracle 19c. Could you please teach me how to fix it?
Thanks,
Eric