0 Replies Latest reply on Dec 11, 2015 4:44 AM by davidfirth

    How do I resolve this Caused by: org.hibernate.TypeMismatchException?

    davidfirth

      I have been working on using Hibernate/JPA in my JBoss Fuse 6.2 environment. I have my EntityManagerFactory being created and I can use it to get an EntityManager and make connections to the database. I came across an interesting issue where if my bundle is deployed to JBoss Fuse and then Fuse is restarted, everything connects fine and I get the results I expect. One issue I have been having though is that when Fuse is already running and I update the bundle again I get this error:

       

      Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.example.models.ModelType . Expected: class com.example.models.pk.ModelPK , got class com.example.models.pk.ModelPK

       

      Am I missing something very simple here or is there a reason as to why the Hibernate is getting the class it is expecting but thinking it isn't?