Spring 3.1 - JPA/Hibernate 4 - "Could not complete schema update"
Bonjour,
J'ai démarré un projet Spring Jpa/Hibernate.
Voici les versions que j'utilise :
- Spring : 3.1.2.RELEASE
- Hibernate : 4.1.5.Final
- Hibernate Annotations : 3.5.6-Final
- Driver Oracle 10 : 10.2.0.4.0
J'ai deux fichier de configuration, un pour Oracle et un pour HSQLDB.
J'ai un test testant la méthode countAll d'un Dao.
Le test sur HSQLDB fonctionne bien. Par contre, quand j'utilise le context Oracle (fichier spring context), j'ai l'exception suivante :
Code:
1 2 3
|
[ERROR][SchemaUpdate ][] HHH000299: Could not complete schema update
java.sql.SQLException: Table not found in statement [select sequence_name from user_sequences] |
Voici mon fichier de configuration Spring (je n'utilise pas d'autres fichiers de config, toutes mes classes sont annotées avec @Entity, @Repository...):
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
">
<context:annotation-config />
<context:component-scan base-package="monpackage.a.scanner" />
<tx:annotation-driven />
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${db.driverClassName}" p:url="${db.url}"
p:password="${db.password}" p:username="${db.username}" />
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean id="jpaAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="${jpa.database}" p:showSql="${jpa.showSql}" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:packagesToScan="monpackage.a.scanner"
p:dataSource-ref="dataSource" p:jpaVendorAdapter-ref="hibernateVendor"
p:jpaPropertyMap-ref="jpaPropertyMap" />
<util:map id="jpaPropertyMap">
<entry key="hibernate.hbm2ddl.auto" value="update" />
<entry key="hibernate.dialect" value="${hibernate.dialect}" />
</util:map>
<bean id="hibernateVendor"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:showSql="${jpa.showSql}" /> |
Pourriez-vous m'aider à régler ce problème ?
Merci Beaucoup.