com.atlassian.confluence.spaces.Space

Atlassian JIRA | Roberto Dominguez | 10 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Argh! have spent several hours on this one... I hope you guys can shed some light on this one... Working on a plugin, in a XWork Action. Action is on Page A of Space M I am traversing Page A's childrens. getting/setting a few content properties ({{contentPropertyManager.get/setTextProperty}}), then create Page B on Space N,This is what I am doing: {code} b = new Page(); b.setTitle(source.getTitle()); b.setContent(source.getContent()); b.setSpace(spaceN); b.setVersionComment(makePublishingComment(approvalCheck)); pageManager.saveContentEntity(b,new DefaultSaveContext()); {code} And I get the Exception below... Funny thing is that I don't mess with A's children right before, It works... {code} 2007-08-20 16:52:10,305 ERROR [http-8082-Processor3] [atlassian.xwork.interceptors.XWorkTransactionInterceptor] onThrowable Invoking rollback for transaction on action '/plugins/approvalsworkflow/save.action (ApprovalsAction.save())' due to throwable: org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space at net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:1687) at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:1453) at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1480) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1403) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:901) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:868) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:790) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:749) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1398) at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:532) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312) at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529) at com.atlassian.hibernate.HibernateObjectDao.saveRaw(HibernateObjectDao.java:148) at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy19.saveContentEntity(Unknown Source) {code} The error is always with that space (id 17432578) that happen to be Space N... Needless to say, I am not modifying Space N at all, just reading it a few statements before adding the page... {{b}}'s id is zero, as it was just created... thing is why is hibernate getting/assinging that existing id!!?!?!??!?!?!?!??!?!?!?!?!?

    Atlassian JIRA | 10 years ago | Roberto Dominguez
    com.atlassian.confluence.spaces.Space
  2. 0

    Argh! have spent several hours on this one... I hope you guys can shed some light on this one... Working on a plugin, in a XWork Action. Action is on Page A of Space M I am traversing Page A's childrens. getting/setting a few content properties ({{contentPropertyManager.get/setTextProperty}}), then create Page B on Space N,This is what I am doing: {code} b = new Page(); b.setTitle(source.getTitle()); b.setContent(source.getContent()); b.setSpace(spaceN); b.setVersionComment(makePublishingComment(approvalCheck)); pageManager.saveContentEntity(b,new DefaultSaveContext()); {code} And I get the Exception below... Funny thing is that I don't mess with A's children right before, It works... {code} 2007-08-20 16:52:10,305 ERROR [http-8082-Processor3] [atlassian.xwork.interceptors.XWorkTransactionInterceptor] onThrowable Invoking rollback for transaction on action '/plugins/approvalsworkflow/save.action (ApprovalsAction.save())' due to throwable: org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space org.springframework.orm.hibernate.HibernateSystemException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 17432578, of class: com.atlassian.confluence.spaces.Space at net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:1687) at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:1453) at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1480) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1403) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:901) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:868) at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:790) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:749) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1398) at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:532) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312) at org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529) at com.atlassian.hibernate.HibernateObjectDao.saveRaw(HibernateObjectDao.java:148) at com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122) at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy19.saveContentEntity(Unknown Source) {code} The error is always with that space (id 17432578) that happen to be Space N... Needless to say, I am not modifying Space N at all, just reading it a few statements before adding the page... {{b}}'s id is zero, as it was just created... thing is why is hibernate getting/assinging that existing id!!?!?!??!?!?!?!??!?!?!?!?!?

    Atlassian JIRA | 10 years ago | Roberto Dominguez
    com.atlassian.confluence.spaces.Space

    Root Cause Analysis

    1. com.atlassian.confluence.spaces.Space

      No message provided

      at net.sf.hibernate.impl.SessionImpl.checkUniqueness()
    2. net.sf.hibernate
      SessionImpl.saveOrUpdate
      1. net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:1687)
      2. net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:1453)
      3. net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1480)
      4. net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1403)
      5. net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114)
      6. net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436)
      7. net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
      8. net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:901)
      9. net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:868)
      10. net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:790)
      11. net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:749)
      12. net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1398)
      12 frames
    3. Hibernate
      HibernateTemplate.saveOrUpdate
      1. org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:532)
      2. org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312)
      3. org.springframework.orm.hibernate.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:529)
      3 frames
    4. com.atlassian.hibernate
      HibernateObjectDao.saveRaw
      1. com.atlassian.hibernate.HibernateObjectDao.saveRaw(HibernateObjectDao.java:148)
      1 frame
    5. com.atlassian.confluence
      DefaultContentEntityManager.saveContentEntity
      1. com.atlassian.confluence.core.DefaultContentEntityManager.saveContentEntity(DefaultContentEntityManager.java:44)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    7. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
      3 frames
    8. com.atlassian.spring
      SpringProfilingInterceptor.invoke
      1. com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:20)
      1 frame
    9. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      1 frame
    10. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
      1 frame
    11. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
      2 frames
    12. Unknown
      $Proxy19.saveContentEntity
      1. $Proxy19.saveContentEntity(Unknown Source)
      1 frame