reset password
Author Message
armandop
Posts: 32
Posted 15:04 Apr 25, 2014 |

I' ve been wresting with this issue for the last 2 days.  I get this error:

Exception in thread "main" org.hibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.  

I googled and found that my db info might be off but i checked and its all working ok.   a bit stumped at this point.

Here is my Persistence.xml file:

<persistence 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_2_0.xsd"

    version="2.0">

 

    <persistence-unit name="springmvc">

        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <properties>

            <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />

            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />

        </properties>

    </persistence-unit>

 

</persistence>

cysun
Posts: 2935
Posted 18:43 Apr 25, 2014 |

Check the name of the persistence unit in both persistence.xml and Hbm2ddl.java and make sure they match. For example, if it says "springmvc" in persistence.xml, it should be "springmvc" in Hbm2ddl.java too.

armandop
Posts: 32
Posted 12:00 Apr 28, 2014 |

Just to close the loop on this if someone else comes across this issue.   I had the wrong Spring Framework:sprint-test version and made sure all Spring related items were set to 3.2.3.RELEASE