Note that there are some explanatory texts on larger screens.

plurals
  1. POProperty 'hibernate.dialect' is unseen (Using Spring Data)
    primarykey
    data
    text
    <p>I'm using Spring Data. I've got "org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set" on deploy to JBoss7. But I did set the property (databasePlatform -> org.hibernate.dialect.MySQL5Dialect) in my app-context.xml:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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:jpa="http://www.springframework.org/schema/data/jpa" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"&gt; &lt;context:component-scan base-package="com.myproj.persistence.jpa" /&gt; &lt;jpa:repositories base-package="com.myproj.persistence.jpa" /&gt; &lt;tx:annotation-driven transaction-manager="transactionManager"/&gt; &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt; &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt; &lt;property name="url" value="jdbc:mysql://myhost:port/schema" /&gt; &lt;property name="username" value="root" /&gt; &lt;property name="password" value="123456" /&gt; &lt;/bean&gt; &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt; &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt; &lt;/bean&gt; &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt; &lt;property name="dataSource" ref="dataSource"/&gt; &lt;property name="persistenceUnitName" value="quizPersistenceUnit"/&gt; &lt;property name="jpaVendorAdapter"&gt; &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt; &lt;property name="showSql" value="false"/&gt; &lt;property name="database" value="MYSQL"/&gt; &lt;property name="generateDdl" value="false"/&gt; &lt;property name="databasePlatform" value="org.hibernate.dialect.MySQL5Dialect"/&gt; &lt;/bean&gt; &lt;/property&gt; &lt;/bean&gt; &lt;/beans&gt; </code></pre> <p>This is my persistence.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt; &lt;persistence-unit name="quizPersistenceUnit"&gt; &lt;class&gt;com.myproj.domain.Quiz&lt;/class&gt; &lt;class&gt;com.myproj.domain.QuizAnswer&lt;/class&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>However, when I set this property in persistence.xml like this:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt; &lt;persistence-unit name="quizPersistenceUnit"&gt; &lt;properties&gt; &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/&gt; &lt;/properties&gt; &lt;class&gt;com.myproj.domain.Quiz&lt;/class&gt; &lt;class&gt;com.myproj.domain.QuizAnswer&lt;/class&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>everything works great. Of course I don't want to link to DB realization in persistence.xml.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload