-->
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.  [ 1 post ] 
Author Message
 Post subject: Error during getSessionFactory Hibernate 5
PostPosted: Wed Aug 26, 2015 3:45 am 
Newbie

Joined: Wed Aug 26, 2015 3:30 am
Posts: 2
Hello,

i get the following Error:
    9:12:45,328 ERROR : ### Exception ###Versuch: 1
    09:12:45,328 ERROR : Message: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
    09:12:45,328 ERROR : org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
    09:12:45,328 ERROR : org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:244)
    09:12:45,328 ERROR : org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:208)
    09:12:45,328 ERROR : org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
    09:12:45,328 ERROR : org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
    09:12:45,328 ERROR : org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
    09:12:45,328 ERROR : org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:217)
    09:12:45,328 ERROR : org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
    09:12:45,329 ERROR : org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
    09:12:45,329 ERROR : org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
    09:12:45,329 ERROR : org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
    09:12:45,329 ERROR : org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)
    09:12:45,329 ERROR : org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
    09:12:45,329 ERROR : database.HibernateUtil.getSessionFactory(HibernateUtil.java:31)
    09:12:45,329 ERROR : database.DatabaseFactoryPostgres.initializePostgres(DatabaseFactoryPostgres.java:156)
    09:12:45,329 ERROR : database.ProjectDatabaseContext.initialize(ProjectDatabaseContext.java:253)
    09:12:45,329 ERROR : main.PrecogsInternal$1.doInBackground(PrecogsInternal.java:121)
    09:12:45,329 ERROR : main.PrecogsInternal$1.doInBackground(PrecogsInternal.java:1)
    09:12:45,329 ERROR : javax.swing.SwingWorker$1.call(Unknown Source)
    09:12:45,329 ERROR : java.util.concurrent.FutureTask.run(Unknown Source)
    09:12:45,329 ERROR : javax.swing.SwingWorker.run(Unknown Source)
    09:12:45,329 ERROR : java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    09:12:45,330 ERROR : java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    09:12:45,330 ERROR : java.lang.Thread.run(Unknown Source)

This is the code:
Code:
    public static SessionFactory getSessionFactory() {
       
       StandardServiceRegistry standardRegistry = new StandardServiceRegistryBuilder()
             .configure( "hibernate.cfg.xml" )
             .build();

       MetadataSources metadataSources = new MetadataSources( standardRegistry );
        for (  String classNameForDatabase  : ProjectDatabaseContext.getAllDatabaseClasses()) {
             try {
                metadataSources.addAnnotatedClass(Class.forName(classNameForDatabase));
             }
          catch (    Exception e) {
             }
           }
       
        Metadata metadata = metadataSources.getMetadataBuilder()
                                   .applyImplicitNamingStrategy( ImplicitNamingStrategyJpaCompliantImpl.INSTANCE )
                                   .build();

       SessionFactory sessionFactory = metadata.getSessionFactoryBuilder()   .build();   
       
       
       
       
       
       


Is there any idea whats going wrong ?


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

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.