-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Unable to build EntityManagerFactory
PostPosted: Sat Nov 22, 2008 11:17 am 
Newbie

Joined: Fri Nov 14, 2008 2:27 pm
Posts: 2
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]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.