Java Coder
The method buildServiceRegistry() is undefined for the type ServiceRegistryBuilder
1 Answer(s)      a year and 5 months ago
Posted in : Hibernate

Hi,

How to solve the error "The method buildServiceRegistry() is undefined for the type ServiceRegistryBuilder" in Hibernate 4.3.1?

I am using the Latest version of Hibernate which is Hibernate 4.3.1 and trying to create the SessionFactory with the help of following code:

Configuration configuration = new Configuration();
configuration.configure();
serviceRegistry = new ServiceRegistryBuilder().applySettings(
        configuration.getProperties()).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);

But following error is coming: The method buildServiceRegistry() is undefined for the type ServiceRegistryBuilder

How to solve the issue?

Thanks

Advertisement
View Answers

February 2, 2014 at 1:18 PM


The method buildServiceRegistry() is changed in Hibernate 4.3.1.

You have to use the latest API.

Check the tutorial Hibernate 4 Hello World: Example of Hello World program where you can find the example of creating the SessionFactory in right way.

Thanks










Related Tutorials/Questions & Answers: