2012-03-04 16 views
2

Play 2.0 ScalaアプリケーションからJPAを使用しようとしています。私のコードでは、私が持っている:有効なpersistence.xmlからEntityManagerを作成できません

val factory = Persistence.createEntityManagerFactory("devcrowd") 

私はまた、パッケージMETA-INFpersistence.xmlを持っている:

<?xml version="1.0" encoding="UTF-8"?> 
<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="devcrowd" transaction-type="RESOURCE_LOCAL"> 
    <provider>org.hibernate.ejb.HibernatePersistence</provider> 
    <properties> 
     <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> 
     <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/> 
     <property name="hibernate.connection.username" value="xxxx"/> 
     <property name="hibernate.connection.password" value="xxxx"/> 
     <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/devcrowd"/> 
    </properties> 
</persistence-unit> 
</persistence> 

このpersistence.xmlのは、私には有効なようだが、工場を作成することはできません。

PersistenceException: No Persistence provider for EntityManager named devcrowd 
+0

スタックトレースを少なくします。 postgresql jdbcがクラスパスにあるかどうか確認してください。 –

+0

そして、それについては休止してください。 –

答えて

1

デプロイ時にHibernateライブラリが欠落しています。

関連する問題