исключение гибернации.mysql5.7 без проблем.MySQL 8 проблема - PullRequest
0 голосов
/ 02 апреля 2019

java.lang.NoClassDefFoundError: Не удалось инициализировать класс Connection.HibernateUtil

hibernate 4.3 с mysql 5.7 нет проблем hibernate 4.3 qith mysql 8 это сообщение об ошибке

connection.HibernateUtil класс ниже

пакет Connection;

import org.hibernate.cfg.AnnotationConfiguration;import org.hibernate.SessionFactory;

открытый класс HibernateUtil {

private static final SessionFactory sessionFactory;

static {
    try {
        // Create the SessionFactory from standard (hibernate.cfg.xml) 
        // config file.
        sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
    } catch (Throwable ex) {
        // Log the exception. 
        System.err.println("Initial SessionFactory creation failed." + ex);
        throw new ExceptionInInitializerError(ex);
    }
}

public static SessionFactory getSessionFactory() {
    return sessionFactory;
}

}

...