Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

The method buildServiceRegistry() is undefined for the type ServiceRegistryBuilder

Ads

 
 

Share on Google+Share on Google+

Java Coder
The method buildServiceRegistry() is undefined for the type ServiceRegistryBuilder
1 Answer(s)      3 years and 6 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

Ads
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


Ads