title: Maven +Hibernate + JPA error .JavaReflectionManager cannot be cast to org.hibernate.annotations.common
body: <p>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:  <a href="http://docs.jboss.org/hibernate/entitymanager/3.5/reference/en/html/configuration.html" rel="nofollow">Hibernate Setup</a>.</p>
  
  <p>I have this but </p>
  
  <pre><code>&lt;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"&gt;
    &lt;persistence-unit name="manager1" transaction-type="JTA"&gt;
        &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
        &lt;properties&gt;
           &lt;property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect"/&gt;       
        &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>When I step through this line in my code:</p>
  
  <pre><code>Session session = HibernateUtil.getSessionFactory().openSession();    
  </code></pre>
  
  <p>The following exception is thrown.  </p>
  
  <pre><code>Initial SessionFactory creation failed.java.lang.ClassCastException: org.hibernate.annotations.common.reflection.java.JavaReflectionManager cannot be cast to org.hibernate.annotations.common.reflection.MetadataProviderInjector
  </code></pre>