Re: [Topia-devel] [Topia-user] topia-persistence-hibernate exception
Erwan Nema a écrit :
Bonjour nous avons créer un petit projet maven de test pour utiliser topia-persistence comme couche de mapping les fichiers de mappings sont correctement générés à partir d'un zargo. le fichier de property H2 est correctement chargé. par contre la tentative de persistence de l'entité génère l'exception suivante :
Chargement du fichier de properties : hibernate.hbm2ddl.auto:create hibernate.dialect:org.hibernate.dialect.H2Dialect Context loaded..... WARN [main] (UserSuppliedConnectionProvider.java:46) configure - No connection properties specified - the user must supply JDBC connections org.hibernate.HibernateException: Hibernate Dialect must be explicitly set at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:80) at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:62) at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:460) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:155) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325) at org.codelutin.topia.framework.TopiaContextImpl.getHibernateFactory(TopiaContextImpl.java:450) at org.codelutin.topia.framework.TopiaContextImpl.beginTransaction(TopiaContextImpl.java:663) at org.codelutin.pollen.TestPersistence.persist(TestPersistence.java:40) at org.codelutin.pollen.TestPersistence.main(TestPersistence.java:66) En fait, c'est la fonction
this.conf = Resource.getConfigProperties("h2.TopiaContextImpl.properties"); qui bug. Le code suivant fonctionne mieux : this.conf = new Properties(); URL url = Resource.getURL("h2.TopiaContextImpl.properties"); conf.load(new FileInputStream(new File(url.toURI()))); -- Éric <chatellier@codelutin.com> Tel: 02 40 50 29 28 http://www.codelutin.com
participants (1)
-
Éric Chatellier