Can someone please provide me with a sample minimalist persistence.xml file that works and how to get it working in code? I am following this document which has frustrating gaps: Hibernate Setup.
I have this but
<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="manager1" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect"/>
</properties>
</persistence-unit>
</persistence>
When I step through this line in my code:
Session session = HibernateUtil.getSessionFactory().openSession();
The following exception is thrown.
Initial SessionFactory creation failed.java.lang.ClassCastException: org.hibernate.annotations.common.reflection.java.JavaReflectionManager cannot be cast to org.hibernate.annotations.common.reflection.MetadataProviderInjector