java.lang.IllegalStateException: Multiple representations of the same entity with @ManyToMany 3 entities

Solution 1:

Fixed it by removing CascadeType.MERGE on Permission entity

Solution 2:

The correct solution would have been to upgrade to hibernate 4.2.15 / 4.3.6 or above and add the following lines to your persistence.xml:

<property name="hibernate.event.merge.entity_copy_observer" value="allow"/>