Buenas tardes,
Estoy haciendo una aplicacion con Hibernate, marcado con anotaciones, y me esta dando el siguiente error:
"
Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
at org.hibernate.type.BasicTypeRegistry.<init>(BasicT ypeRegistry.java:94)
at org.hibernate.type.TypeResolver.<init>(TypeResolve r.java:59)
at org.hibernate.cfg.Configuration.<init>(Configurati on.java:250)
at org.hibernate.cfg.Configuration.<init>(Configurati on.java:302)
at org.hibernate.cfg.AnnotationConfiguration.<init>(A nnotationConfiguration.java:108)
at hibernate.Main.main(Main.java:9)"
Mi fichero de configuracion de hibernate es:
"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driv er</property>
<property name="connection.url">jdbc:mysql://localhost/hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password">admin</property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQL5Dialect </property>
<property name="show_sql">true</property>
<property name="hbm2dll.auto">create-drop</property>
<mapping class="hibernate.Contacto" />
</session-factory>
</hibernate-configuration>"
Y mi fichero de ejecucion es:
"
package hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
public class Main {
public static void main(String[] args) {
SessionFactory sesionFactory = new AnnotationConfiguration().configure().buildSession Factory();
Session sesion = sesionFactory.openSession();
sesion.beginTransaction();
Contacto c = new Contacto("pedro", "[email protected]", "987654321");
sesion.save(c);
sesion.getTransaction().commit();
sesion.close();
}
}"
Estoy buscando la solucion, y no la consigo. ¿Alguien ha solucionado alguna vez este error?
Muchas gracias a todos.