Hi out there,
it is really difficult to create a useful and short subject for my problem, so I just named the important things and explain here.
I have an EJB3 application on JBoss 4.0.3 with Entity Beans (persisted by Hibernate). All of my Entity Beans have one parent Entity Bean that has various attributes that every table of our database has - among others the primary key "id". Now I have one Entity Bean (MenuXForm) that has a relation to "Menu" and "Form" Entities (ManyToOne). When selecting MenuXForm entities I get an exception when there is for example a Menu Entity with id = 12 selected, and there already exists a Form Entity with id = 12 in the cache. Then Hibernate tries to set the existing Form Entity as a Menu Entity. The exception that occurs is a
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of de.weltbild.wbmsadmin.j2ee.entities.MenuXForm.setMenu