I\'m just trying to learn Hibernate (version 4 final) but I have a problem when trying to create the session factory. Here is some code related to the problem:
hi
I encountered similar problems trying to use Hibernate 4.1.6.
Building on an example from RoseIndia.net, I got ServiceRegistryBuilder working like this:
Configuration config = new Configuration();
config.configure();
ServiceRegistryBuilder srBuilder = new ServiceRegistryBuilder();
srBuilder.applySettings(config.getProperties());
ServiceRegistry serviceRegistry = srBuilder.buildServiceRegistry();
SessionFactory factory = config.buildSessionFactory(serviceRegistry);
My hibernate.cfg.xml file uses the old DTD file; I have not been able to get the new XSD file to be recognized by Hibernate 4.1.6:
...
Perhaps you can adapt this to work for you?