Cześć.
Mam taki problem na Jetty 7.4.5 w eclipsie tworzę projekt JPA + Web project.
Mój presistence.xml wygląda tak:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="MyPersistence" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>pl.bgora.entity.User</class>
<class>pl.bgora.entity.Message</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
<property name="hibernate.connection.username" value="sa" />
<property name="hibernate.connection.password" value="" />
<!-- Please change this for your own system needs!!!!! -->
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:c:/mydb.dat" />
</properties>
</persistence-unit>
</persistence>
Niestety przy odpaleniu serwera Jetty dostaję taki błąd:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/createUser' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot create inner bean 'pl.bgora.dao.impl.UserDaoHibernate#9903f4' of type [pl.bgora.dao.impl.UserDaoHibernate] while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pl.bgora.dao.impl.UserDaoHibernate#9903f4' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [pl.bgora.dao.impl.UserDaoHibernate]: Constructor threw exception; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: MyPersistence] Unable to build EntityManagerFactory
Używam HSQLDB, aby zapisywać do pliku na dysku i hibernate'a dla klas.
Miał ktoś podobny problem?
Wydaje się, ze wszystko jest ok.
Pozdro.