-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 4.3 Session Factory
PostPosted: Sun Sep 15, 2013 1:41 pm 
Newbie

Joined: Sun Sep 15, 2013 1:17 pm
Posts: 6
Preface: Windows 7 64bit, Eclipse Juno, JRE 7, Maven m2e 1.3.1, jboss as 7.1.1, Hibernate 4.3beta (built from git with Gradle)

I tried to use the StandardServiceRegistry and the MetaDataSource as the Docs suggest;

Code:

    standardServiceReg= new StandardServiceRegistryBuilder();
    serviceReg= standardServiceReg.configure("hibernate.cfg.xml").build();
    MetadataSources metaSource= new MetadataSources( serviceReg.getParentServiceRegistry());
    sessionFactory = metaSource.buildMetadata().buildSessionFactory();


In an effort to get the sessionFactory; I updated my .cfg.xml headers to match the 4.3 docs of example 1.2 hibernate.cfg.xml
http://docs.jboss.org/hibernate/orm/4.3/devguide/en-US/html_single/
As well as the property attribute name="hibernate.dialect" and name="dialect" (I tried both as the error indicates i do not set the dialect)

Errors:
Code:
11:28:03,353 WARN  [org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator] (http-localhost-127.0.0.1-8080-3) HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
11:28:03,362 ERROR [stderr] (http-localhost-127.0.0.1-8080-3) org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set

11:28:03,364 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:98)

11:28:03,365 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:66)

11:28:03,367 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:193)

11:28:03,368 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:89)

11:28:03,369 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:160)

11:28:03,371 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:132)

11:28:03,372 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:147)

11:28:03,374 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:198)

11:28:03,375 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:157)

11:28:03,376 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:132)

11:28:03,378 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.metamodel.source.internal.MetadataImpl.<init>(MetadataImpl.java:119)

11:28:03,379 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.metamodel.source.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:122)

11:28:03,380 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at org.hibernate.metamodel.MetadataSources.buildMetadata(MetadataSources.java:149)

11:28:03,382 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at dal.DAL.configureSessionFactory(DAL.java:84)

11:28:03,382 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at dal.DAL.sessionManager(DAL.java:96)

11:28:03,383 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at dal.DAL.loginUser(DAL.java:338)

11:28:03,384 ERROR [stderr] (http-localhost-127.0.0.1-8080-3)    at login.login.executeLogin(login.java:108)


Any guidance is appreciated.


Top
 Profile  
 
 Post subject: Re: Hibernate 4.3 Session Factory
PostPosted: Sun Sep 15, 2013 9:39 pm 
Newbie

Joined: Sun Sep 15, 2013 1:17 pm
Posts: 6
Gentlemen!
I have found an implementation here
Git REPO: \hibernate-testing\src\main\java\org\hibernate\testing\junit4\BaseCoreFunctionalTestCase.java
method buildSessionFactory()

Cheers!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.