Issue
I have read StandardServiceRegistryBuilder related posts on SO, but it doesn't seem to solve my problem. This is the code that I am trying to run:
import javax.imageio.spi.ServiceRegistry;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class TestHibernate {
public static void main(String args[]){
UserDetails userDetails = new UserDetails();
userDetails.setAge(22);
userDetails.setName("Saurabh");
Configuration configuration = new Configuration();
configuration.configure();
StandardServiceRegistryBuilder serviceRegistryBuilder = new StandardServiceRegistryBuilder(); //this is where i get error
serviceRegistryBuilder.applySettings(configuration.getProperties());
ServiceRegistry serviceRegistry = serviceRegistryBuilder.build();
SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
This is the error given by netbeans:
cannot find symbol
How can I solve this issue?
Solution
You imported incorrect class, you need
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.registry.StandardServiceRegistry;
Answered By - jmj
Answer Checked By - Pedro (JavaFixing Volunteer)