1

I've just upgraded my project from Hibernate 4.2.8 to Hibernate 5.2.12.Final The only change in terms of configuration is the persistence provider, instead of org.hibernate.ejb.HibernatePersistence it's now org.hibernate.jpa.HibernatePersistenceProvider.

All of a sudden my Unit Tests which use H2 fail with:

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.h2.jdbc.JdbcSQLException: Wrong user name or password [28000-166]

Any idea what is causing it? My H2 configuration in the persistence.xml has not changed:

       <properties>
            <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:MyDB;INIT=runscript from 'classpath:/com/camel/database.sql'" />
            <property name="javax.persistence.jdbc.user" value="SA" />
            <property name="javax.persistence.jdbc.password" value="" />

            <property name="hibernate.hbm2ddl.auto" value="none" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
            <property name="hibernate.cache.use_query_cache" value="true" />
            <property name="hibernate.max_fetch_depth" value="4" />
            <property name="hibernate.cache.use_second_level_cache" value="true" />
            <property name="hibernate.cache.use_query_cache" value="true" />
            <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory" />
        </properties>
tung
  • 719
  • 2
  • 14
  • 30
Gep
  • 848
  • 13
  • 29

0 Answers0