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 ?