4 Replies Latest reply on Aug 16, 2011 8:53 AM by faber81

    JBoss - Persistence JPA hibernate

    faber81 Newbie

      Hi,

      i'm developed a application web with hibernate JPA, Jboss 6, Mysql, but I get the following error:

       

      Error installing to Start: name=persistence.unit:unitName=XXXXXXXXXXXXXX#XXXXXXXX state=Create: java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType

       

      My persistence.xml

      <?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="XXXXXXXXX" transaction-type="RESOURCE_LOCAL">

                          <provider>org.hibernate.ejb.HibernatePersistence</provider>

       

                          <non-jta-data-source>java:XXXXXXXXX</non-jta-data-source>

                          <class>...............................</class>

                <class>...............................</class>

                          <properties>

       

                                    <!-- DATA SOURCE -->

                                    <property name="hibernate.connection.datasource" value="java:datasouce" />

       

                     <!-- DIALECT-->

                                      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />

       

                                     <!-- CATALOG -->

                                    <property name="hibernate.default_catalog" value="db"/>

                          </properties>

                </persistence-unit>

      </persistence>

      My datasource is into the folder C:\jboss-6.0.0.Final\server\default\deploy

       

      Thank.