3 Replies Latest reply on Oct 29, 2010 2:17 AM by sunay

    jboss 5 : Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQL5InnoDBDialect

    sunay

      Hello All,

       

      I am new bie here, i don't understand why this exception comes.

       

      Situation :: I have hibernate.jar in my war folder and it is also in common\lib i created jboss-web.xml and dropped it in web-inf folder

       

      still i am getting this error

       

      i already gone through wiki page of jboss

       

       

      see the

       


      <jboss-web>
           <class-loading java2ClassLoadingCompliance="false">
               <loader-repository>
                   com.enovate.bpm:loader=jsf-console.war<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
               </loader-repository>
           </class-loading>

      </jboss-web>

       

      thanks

      sunay

        • 1. Re: jboss 5 : Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQL5InnoDBDialect
          peterj

          It would help us a lot if you posted the full stack trace. But most likely the problem is that you included hibernate.jar in your WAR file - removing it should get you running again.

          1 of 1 people found this helpful
          • 2. Re: jboss 5 : Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQL5InnoDBDialect
            fstani

            Sunay,

             

            You only need to configure the classloader if by any reason you are using a incompatible version of hibernate, to the one already deployed by JBoss, but if you are going to bundle hibernate you need to add all the classes you are going to use, such as entity-manager, etc..

             

            A stack trace and JBoss version information would be nice too.

             

            Peter,

             

            In JBoss AS 5 you can bundle hibernate libs inside the web application, with the classloading isolation active, if you need to use a specific version of hibernate with you war file. Of course better is to use what is available in the JBoss environment if you are the one coding the application. Bundling the wars should only be the case when migrating applications where you don't have access to the source code.

            1 of 1 people found this helpful
            • 3. Re: jboss 5 : Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQL5InnoDBDialect
              sunay

              Peter,

               

              You are right peter , if i am removing the jar from the web-inf/ lib then server is starting , actually i have problem in hibernate , My test case made for merging blob field is working , and i am using hibernate 3.2.6 ga [hibernate.jar] for that , jboss 5.0.0 AS using the older hibernate.jar . so i thought i need to change the jar of hibernate , if i replace hibernate-core.jar that is already available in common\lib folder with hibernate.jar and starting the server at that time server is starting properly. but my hibernate issue still there . so i need to confirm it with hibernate community. anyways thanks for the reply.

               

               

              fstani ,

               

              you are right , i have fuzzy idea abt that i need to change hibernate jar if i am going to use different version of hibernate. actually you can see that what i mentioned to peter what my actual problem is , thats why i want to change my hibernate jars . let me confirm with hibernate community ppl about my isssue reagarding this

               

              Thanks

              sunay