Hallo
Ich möchte gerne eine Web-Anwendung mit Spring und Hibernate schreiben. Das Problem ist jetzt, ich bekomme jetzt folgende Exception:
Ich verstehe nun nicht was das Problem ist. Meine persistence.xml liegt im Verzeichnis /war/WEB-INF/classes/META-INF:
[XML]<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="TioPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<!-- config of db-connection -->
<!-- update the database schema on startup -->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MSAccessDialect"/>
<property name="hibernate.connection.driver_class" value="sun.jdbc.odbc.JdbcOdbcDriver"/>
<property name="hibernate.connection.url" value="jdbcdbc:tio"/>
<property name="hibernate.connection.username" value=""/>
<property name="hibernate.connection.password" value=""/>
<!-- config of connection pool -->
<!-- define the number of Connections that will be pooled -->
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="300"/>
<!-- The size of c3p0's PreparedStatement cache. -->
<property name="hibernate.c3p0.max_statements" value="50"/>
<!-- perform a test of the connection after x-seconds -->
<property name="hibernate.c3p0.idle_test_period" value="3000"/>
</properties>
</persistence-unit>
</persistence>
[/XML]
Könnte mir bitte jemand weiterhelfen.
mfg
Ich möchte gerne eine Web-Anwendung mit Spring und Hibernate schreiben. Das Problem ist jetzt, ich bekomme jetzt folgende Exception:
Java:
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named TioPersistenceUnit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:92)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 28 more
Ich verstehe nun nicht was das Problem ist. Meine persistence.xml liegt im Verzeichnis /war/WEB-INF/classes/META-INF:
[XML]<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="TioPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<!-- config of db-connection -->
<!-- update the database schema on startup -->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MSAccessDialect"/>
<property name="hibernate.connection.driver_class" value="sun.jdbc.odbc.JdbcOdbcDriver"/>
<property name="hibernate.connection.url" value="jdbcdbc:tio"/>
<property name="hibernate.connection.username" value=""/>
<property name="hibernate.connection.password" value=""/>
<!-- config of connection pool -->
<!-- define the number of Connections that will be pooled -->
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="300"/>
<!-- The size of c3p0's PreparedStatement cache. -->
<property name="hibernate.c3p0.max_statements" value="50"/>
<!-- perform a test of the connection after x-seconds -->
<property name="hibernate.c3p0.idle_test_period" value="3000"/>
</properties>
</persistence-unit>
</persistence>
[/XML]
Könnte mir bitte jemand weiterhelfen.
mfg