ExceptionInInitializerError в hibernateFactory - PullRequest
0 голосов
/ 02 июля 2019

В моем классе HibernateFactory, когда я пытаюсь получить объект sessionFactory, используя приведенный ниже код, я получаю ExceptionInInitializerError.

Configuration configuration= new Configuration();
ServiceRegistry serviceRegistryObj = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();

Я получаю ошибку в строке ниже

sessionFactoryObj = configuration.buildSessionFactory(serviceRegistryObj);

Ошибка

Error: java.lang.ExceptionInInitializerError com.abc.xyz.conf.HibernateFactory.getSessionFactory(HibernateFactory.java:51) com.abc.xyz.service.UserService.getUser(UserService.java:155) com.abc.xyz.service.UserService.authenticate(UserService.java:378) com.abc.xyz.controller.UserController.authenticate(UserController.java:297) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
...