Hello,
I'm trying to create an EntityManagerFactory but it doesn't seem to work.
I always get this Error message.
javax.persistence.PersistenceException [PersistenceUnit: webshop] Unable to build EntityManagerFactory
Code:
private static final String PERSISTENCE_UNIT = "webshop";
public static void init()
{
emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
}
This is my persistence.xml
Code:
<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">
<persistence-unit name="webshop" transaction-type="JTA">
<!-- Provider -->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- Properties -->
<properties>
<!-- Database connection -->
<property name="hibernate.connection.url" value="jdbc:postgresql:webshop" />
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.username" value="webshop" />
<property name="hibernate.connection.password" value="webshop" />
<property name="hibernate.default_schema" value="webshop_dev" />
<!-- Hibernate dialect -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<!-- Output goodies -->
<property name="hibernate.query.jpaql_strict_compliance" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.use_sql_comments" value="true" />
<!-- Cache -->
<property name="hibernate.jdbc.batch_versioned_data" value="true" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
</properties>
</persistence-unit>
</persistence>
Hope you can help me.[/code]