java.lang.IllegalArgumentException: Cannot copy an object from another Realm instance.

Stack Overflow | Alex Kombo | 2 months ago
  1. 0

    Error copying object to Realm

    Stack Overflow | 2 months ago | Alex Kombo
    java.lang.IllegalArgumentException: Cannot copy an object from another Realm instance.
  2. 0

    RealmObject not found in Query - hence Object is null. Why?

    Stack Overflow | 1 year ago | Coding John
    java.lang.IllegalArgumentException: RealmList does not accept null values
  3. 0

    Cannot copy Retrofit generated RealmObject to Realm: IllegalArgumentException

    Stack Overflow | 8 months ago | Marcel50506
    java.lang.IllegalArgumentException: Cannot copy an object from another Realm instance.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h3. Steps to reproduce: 1. Create 2 spaces and a page to hold the content property 2. Create a content property on the page. e.g. {noformat} curl -v -u admin:admin -d '{"key":"first","value":"junk"}' -H 'Content-type: application/json' http://localhost:8080/confluence/rest/api/content/753671/property {noformat} 3. Move the page to the other space 4. Update the content property. e.g. {noformat} curl -v -u admin:admin -d '{"key":"first","value":"other junk","version":{"number":2}}' -X PUT -H 'Content-type: application/json' http://localhost:8080/confluence/rest/api/content/753671/property/first {noformat} Expected: * content is updated Actual: * A 500 error with the result: {noformat} {"statusCode":500,"message":"java.lang.IllegalArgumentException: Can't add an owner from another space."} {noformat} * A stack trace on the server side saying: {noformat} 2016-01-18 15:32:18,874 ERROR [http-bio-8080-exec-14] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error : -- url: /confluence/rest/api/content/753671/property/first | traceId: e6efdd932abc426d | userName: admin java.lang.IllegalArgumentException: Can't add an owner from another space. at com.atlassian.confluence.content.CustomContentEntityObject.checkContainerHierarchyValid(CustomContentEntityObject.java:244) at com.atlassian.confluence.content.CustomContentEntityObject.setContainer(CustomContentEntityObject.java:140) at com.atlassian.confluence.plugins.contentproperty.StorageJsonPropertyManager.updateStorageFromApi(StorageJsonPropertyManager.java:50) at com.atlassian.confluence.plugins.contentproperty.ContentPropertyServiceImpl.update(ContentPropertyServiceImpl.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at com.atlassian.plugins.spring.interceptor.plugin.ExportableInterceptorAdapter$WrappedMethodInvocation.proceed(ExportableInterceptorAdapter.java:53) at com.atlassian.plugins.spring.interceptor.spi.SpringInterceptorAdapter$SpringMethodInvocationAdapter.proceed(SpringInterceptorAdapter.java:50) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at com.atlassian.plugins.spring.interceptor.spi.SpringInterceptorAdapter.invoke(SpringInterceptorAdapter.java:23) at sun.reflect.GeneratedMethodAccessor828.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy350.invoke(Unknown Source) at com.atlassian.plugins.spring.interceptor.plugin.ExportableInterceptorAdapter.invoke(ExportableInterceptorAdapter.java:26) at sun.reflect.GeneratedMethodAccessor827.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy589.invoke(Unknown Source) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy607.update(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy1067.update(Unknown Source) at com.atlassian.confluence.plugins.restapi.resources.ContentPropertyResource.update(ContentPropertyResource.java:218) {noformat}

    Atlassian JIRA | 11 months ago | Richard Atkins [Atlassian]
    java.lang.IllegalArgumentException: Can't add an owner from another space.
  6. 0

    h3. Steps to reproduce: 1. Create 2 spaces and a page to hold the content property 2. Create a content property on the page. e.g. {noformat} curl -v -u admin:admin -d '{"key":"first","value":"junk"}' -H 'Content-type: application/json' http://localhost:8080/confluence/rest/api/content/753671/property {noformat} 3. Move the page to the other space 4. Update the content property. e.g. {noformat} curl -v -u admin:admin -d '{"key":"first","value":"other junk","version":{"number":2}}' -X PUT -H 'Content-type: application/json' http://localhost:8080/confluence/rest/api/content/753671/property/first {noformat} Expected: * content is updated Actual: * A 500 error with the result: {noformat} {"statusCode":500,"message":"java.lang.IllegalArgumentException: Can't add an owner from another space."} {noformat} * A stack trace on the server side saying: {noformat} 2016-01-18 15:32:18,874 ERROR [http-bio-8080-exec-14] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error : -- url: /confluence/rest/api/content/753671/property/first | traceId: e6efdd932abc426d | userName: admin java.lang.IllegalArgumentException: Can't add an owner from another space. at com.atlassian.confluence.content.CustomContentEntityObject.checkContainerHierarchyValid(CustomContentEntityObject.java:244) at com.atlassian.confluence.content.CustomContentEntityObject.setContainer(CustomContentEntityObject.java:140) at com.atlassian.confluence.plugins.contentproperty.StorageJsonPropertyManager.updateStorageFromApi(StorageJsonPropertyManager.java:50) at com.atlassian.confluence.plugins.contentproperty.ContentPropertyServiceImpl.update(ContentPropertyServiceImpl.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at com.atlassian.plugins.spring.interceptor.plugin.ExportableInterceptorAdapter$WrappedMethodInvocation.proceed(ExportableInterceptorAdapter.java:53) at com.atlassian.plugins.spring.interceptor.spi.SpringInterceptorAdapter$SpringMethodInvocationAdapter.proceed(SpringInterceptorAdapter.java:50) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at com.atlassian.plugins.spring.interceptor.spi.SpringInterceptorAdapter.invoke(SpringInterceptorAdapter.java:23) at sun.reflect.GeneratedMethodAccessor828.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy350.invoke(Unknown Source) at com.atlassian.plugins.spring.interceptor.plugin.ExportableInterceptorAdapter.invoke(ExportableInterceptorAdapter.java:26) at sun.reflect.GeneratedMethodAccessor827.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy589.invoke(Unknown Source) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy607.update(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) at com.sun.proxy.$Proxy1067.update(Unknown Source) at com.atlassian.confluence.plugins.restapi.resources.ContentPropertyResource.update(ContentPropertyResource.java:218) {noformat}

    Atlassian JIRA | 11 months ago | Richard Atkins [Atlassian]
    java.lang.IllegalArgumentException: Can't add an owner from another space.

  1. brunosatriani 13 times, last 6 months ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Cannot copy an object from another Realm instance.

    at io.realm.RealmList.copyToRealmIfNeeded()
  2. io.realm
    RealmList.add
    1. io.realm.RealmList.copyToRealmIfNeeded(RealmList.java:261)
    2. io.realm.RealmList.add(RealmList.java:190)
    2 frames
  3. com.radioafrica.music
    AudioPlayer$1.execute
    1. com.radioafrica.music.activity.AudioPlayer$1.execute(AudioPlayer.java:193)
    1 frame
  4. io.realm
    Realm$1.run
    1. io.realm.Realm$1.run(Realm.java:1187)
    1 frame
  5. io.realm.internal
    BgPriorityRunnable.run
    1. io.realm.internal.async.BgPriorityRunnable.run(BgPriorityRunnable.java:34)
    1 frame
  6. Java RT
    Thread.run
    1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
    2. java.util.concurrent.FutureTask.run(FutureTask.java:237)
    3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    5. java.lang.Thread.run(Thread.java:818)
    5 frames