java.lang.UnsupportedOperationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 84#254071991
    via GitHub by mgamboa
    ,
  • GitHub comment 84#255477530
    via GitHub by mgamboa
    ,
  • Spring using collection in @PostFilter
    via Stack Overflow by Sergii
    ,
  • exception while saving tags
    via GitHub by damithc
    ,
  • Orika - map Page<T> to Page<TDto>
    via Stack Overflow by kbysiec
    ,
  • chronicle queue serialising throwables
    via Stack Overflow by Dan
    ,
  • Cat cat = new Cat(); cat.setId( new CatPk() ); cat.getId().setName( "titi" ); cat.getId().setThoroughbred( "unknown" ); Set<Woman> women = new HashSet<Woman>(); Woman woman = new Woman(); woman.setId( new WomanPk() ); woman.getId().setFirstName( "Lady" ); woman.getId().setLastName( "McBeth" ); women.add( woman ); cat.setHumanContacts( Collections.unmodifiableSet( women ) ); Set<Cat> cats = new HashSet<Cat>(); cats.add( cat ); woman.setCats( Collections.unmodifiableSet(cats) ); s.persist( cat ); s.persist( woman ); tx.commit(); s.merge( woman ); During merge, the entity is copied into itself (?) defaultmergeeventlistener.entityIsPersistent() => copyValues(persister, entity, entity, source, copyCache); java.lang.UnsupportedOperationException at java.util.Collections$UnmodifiableCollection.clear(Collections.java:1037) at org.hibernate.collection.PersistentSet.clear(PersistentSet.java:247) at org.hibernate.type.CollectionType.replaceElements(CollectionType.java:404) at org.hibernate.type.CollectionType.replace(CollectionType.java:449) at org.hibernate.type.TypeFactory.replace(TypeFactory.java:437) at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:282) at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:132) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:105) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:51) at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665) at org.hibernate.test.annotations.manytomany.ManyToManyTest.testUnmodifiableCollection(ManyToManyTest.java:102) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.hibernate.test.annotations.TestCase.runTest(TestCase.java:67) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) What is the reason for that? The spec says that "If X is a managed entity, it is ignored by the merge operation"
    via by Emmanuel Bernard,
    • java.lang.UnsupportedOperationException: null at java.util.Collections$UnmodifiableCollection.clear(Collections.java:1074)[na:1.8.0_102] at org.exoplatform.chat.services.mongodb.MongoBootstrap.getDB(MongoBootstrap.java:126)[server-1.3.0.jar:1.3.0] at org.exoplatform.chat.services.mongodb.MongoBootstrap.getDB(MongoBootstrap.java:112)[server-1.3.0.jar:1.3.0] at org.exoplatform.chat.services.MigrateService.<init>(MigrateService.java:22)[server-1.3.0.jar:1.3.0] at org.exoplatform.chat.listener.MigrateServiceListener.contextInitialized(MigrateServiceListener.java:19)[server-1.3.0.jar:1.3.0] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099)[catalina.jar:7.0.70] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)[catalina.jar:7.0.70] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)[catalina.jar:7.0.70] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)[catalina.jar:7.0.70] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)[catalina.jar:7.0.70] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)[catalina.jar:7.0.70] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)[catalina.jar:7.0.70] at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)[catalina.jar:7.0.70] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0_102] at java.util.concurrent.FutureTask.run(FutureTask.java:266)[na:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_102] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_102]
    No Bugmate found.