java.lang.ClassCastException

java.util.HashSet cannot be cast to org.hibernate.collection.spi.PersistentCollection

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web19037

  • via Hibernate JIRA by Alexander Pinske, 11 months ago
    java.util.HashSet cannot be cast to org.hibernate.collection.spi.PersistentCollection
  • via Spring JIRA by Petar Tahchiev, 1 year ago
    java.util.LinkedHashSet cannot be cast to org.hibernate.collection.spi.PersistentCollection
  • via Spring JIRA by Petar Tahchiev, 11 months ago
    java.util.LinkedHashSet cannot be cast to org.hibernate.collection.spi.PersistentCollection
  • Stack trace

    • java.lang.ClassCastException: java.util.HashSet cannot be cast to org.hibernate.collection.spi.PersistentCollection at org.hibernate.event.internal.FlushVisitor.processCollection(FlushVisitor.java:39) at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:104) at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:65) at org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:59) at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:155) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:216) at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:85) at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38) at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1397) at eu.pinske.test.ThingTest.test(ThingTest.java:30)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.