title: Persistence deployment issue
body: <p>I have a hibernate project, which uses JPA.</p>
  
  <p>my persistence.xml contents is as follows:</p>
  
  <pre><code>&lt;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"&gt;
    &lt;persistence-unit name="Demo-PU" transaction-type="RESOURCE_LOCAL"&gt;
    &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;non-jta-data-source&gt;java:/DemoDS&lt;/non-jta-data-source&gt; 
      &lt;class&gt;com.demo.framework.entity.ReportDefinitionEntity&lt;/class&gt; 
      &lt;properties&gt;
  
  &lt;!--  Database connection --&gt;
    &lt;property name="hibernate.connection.url" value="jdbc:mysql://192.168.9.110:3306/demoDB" /&gt;
    &lt;property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" /&gt;
    &lt;property name="hibernate.connection.username" value="root" /&gt;
    &lt;property name="hibernate.connection.password" value="root" /&gt;
  
   &lt;!--  Hibernate dialect  --&gt;
    &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /&gt;
  &lt;!--  Output goodies
    --&gt;
    &lt;property name="hibernate.query.jpaql_strict_compliance" value="true" /&gt;
    &lt;property name="hibernate.format_sql" value="true" /&gt;
    &lt;property name="hibernate.use_sql_comments" value="false" /&gt;
     &lt;!--  Cache
    --&gt;
    &lt;property name="hibernate.jdbc.batch_versioned_data" value="true" /&gt;
    &lt;property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" /&gt;
  
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Now when I run it using eclipse I don't have a problem, but when I deploy it in Jboss, I get the below error:</p>
  
  <blockquote>
    <p>ERROR [AbstractKernelController] Error
    installing to Start:
    name=persistence.unit:unitName=#Demo-PU
    state=Create
    java.lang.ClassCastException:
    org.hibernate.ejb.HibernatePersistence
    cannot be cast to
    javax.persistence.spi.PersistenceProvider</p>
  </blockquote>
  
  <p>And here is the list of Jar that I have</p>
  
  <pre><code>activation.jar
  antlr-2.7.6.jar
  asm-attrs.jar
  asm.jar
  cglib-2.1.3.jar
  commons-collections-2.1.1.jar
  commons-logging-1.1.jar
  dom4j-1.6.1.jar
  ehcache-1.2.3.jar
  hibernate-annotations.jar
  hibernate-commons-annotations.jar
  hibernate-entitymanager.jar
  hibernate-tools.jar
  hibernate3.jar
  javassist.jar
  javax.persistence.jar
  jdbc2_0-stdext.jar
  jta.jar
  mysql-connector-java-5.0.5-bin.jar
  xml-writer.jar
  </code></pre>
  
  <p>How can I resolve this issue?</p>