Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-40753

Copy/pasting wiki attachment to template causes failure in save

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Steps to reproduce:

      1. In admin panel, click "add global template page"
      2. Copy/past content in from another page, including an image attachment. Note that all looks fine in the editor.
      3. Click save

      NOTE: This also occurs with standard templates, not just global templates.

      The save action will (silently) fail, and the new template will not appear in the list. This is the relevant error log for Confluence 7.4:

      2016-02-18 13:06:08,826 WARN [http-bio-8080-exec-3] [xhtml.editor.embed.EditorEmbeddedImageResourceUnmarshaller] unmarshal Error unmarshaling editor embedded image
       -- referer: http://localhost:8080/confluence/pages/templates2/createpagetemplate.action?key= | url: /confluence/pages/templates2/docreatepagetemplate.action | traceId: 7ce104360fdd84a6 | userName: ad
      min | action: docreatepagetemplate
      java.lang.IllegalArgumentException: Content must not be null
              at org.springframework.util.Assert.notNull(Assert.java:112)
              at com.atlassian.confluence.pages.attachments.CachingAttachmentDao.getLatestAttachment(CachingAttachmentDao.java:67)
              at com.atlassian.confluence.pages.DefaultAttachmentManager.getAttachment(DefaultAttachmentManager.java:125)
              at com.atlassian.confluence.pages.DefaultAttachmentManager.getAttachment(DefaultAttachmentManager.java:91)
              at com.atlassian.confluence.pages.DelegatorAttachmentManager.getAttachment(DelegatorAttachmentManager.java:101)
              at com.atlassian.confluence.pages.CachingAttachmentManager.getAttachment(CachingAttachmentManager.java:158)
              at sun.reflect.GeneratedMethodAccessor668.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:307)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at com.sun.proxy.$Proxy132.getAttachment(Unknown Source)
              at com.atlassian.confluence.content.render.xhtml.editor.embed.EditorEmbeddedImageResourceUnmarshaller.unmarshal(EditorEmbeddedImageResourceUnmarshaller.java:94)
              at com.atlassian.confluence.content.render.xhtml.editor.embed.EditorEmbeddedImageResourceUnmarshaller.unmarshal(EditorEmbeddedImageResourceUnmarshaller.java:41)
              at com.atlassian.confluence.content.render.xhtml.UnmarshalMarshalFragmentTransformer.transform(UnmarshalMarshalFragmentTransformer.java:28)
              at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transformFragment(DefaultFragmentTransformer.java:141)
              at com.atlassian.confluence.content.render.xhtml.transformers.DefaultFragmentTransformer.transform(DefaultFragmentTransformer.java:123)
              at com.atlassian.confluence.content.render.xhtml.editor.EditorXhtmlTransformer.transform(EditorXhtmlTransformer.java:45)
              at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:33)
              at com.atlassian.confluence.content.render.xhtml.TransformerChain.transform(TransformerChain.java:33)
              at com.atlassian.confluence.content.render.xhtml.PluggableTransformerChain.transform(PluggableTransformerChain.java:39)
              at com.atlassian.confluence.content.render.xhtml.editor.DefaultEditorConverter.convert(DefaultEditorConverter.java:37)
              at com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter.convertToStorageFormat(DefaultFormatConverter.java:123)
              at com.atlassian.confluence.plugins.templates.actions.CreatePageTemplateAction.createPageTemplate(CreatePageTemplateAction.java:36)
              at com.atlassian.confluence.plugins.templates.actions.CreatePageTemplateAction.execute(CreatePageTemplateAction.java:20)
              at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
              at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
              at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
              at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:58)
      

      On Confluence 7.7 the save does not occurs and this message is displayed on the screem:

      Cause
      javax.persistence.PersistenceException: org.hibernate.HibernateException: Unable to resolve entity name from Class [com.atlassian.confluence.content.render.xhtml.DefaultConversionContext$1] expected instance/subclass of [com.atlassian.confluence.core.ContentEntityObject]
          at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:149)
      
      caused by: org.hibernate.HibernateException: Unable to resolve entity name from Class [com.atlassian.confluence.content.render.xhtml.DefaultConversionContext$1] expected instance/subclass of [com.atlassian.confluence.core.ContentEntityObject]
          at org.hibernate.tuple.entity.PojoEntityTuplizer.determineConcreteSubclassEntityName(PojoEntityTuplizer.java:316)
      
      Stack Trace:[hide]
      javax.persistence.PersistenceException: org.hibernate.HibernateException: Unable to resolve entity name from Class [com.atlassian.confluence.content.render.xhtml.DefaultConversionContext$1] expected instance/subclass of [com.atlassian.confluence.core.ContentEntityObject]
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:149)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
      	at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164)
      	at com.atlassian.hibernate.util.SessionHelper.flushAllowNoTransaction(SessionHelper.java:83)
      	at com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao.save(VersionedHibernateObjectDao.java:145)
      	at jdk.internal.reflect.GeneratedMethodAccessor2218.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy125.save(Unknown Source)
      	at com.atlassian.confluence.pages.templates.Defa
      

      Happens in Chrome, IE and Firefox.

      Attachments

        1. image-2016-02-11-16-45-24-485.png
          image-2016-02-11-16-45-24-485.png
          140 kB
        2. Support+-+General+Info.mht
          418 kB
        3. viewpagestorage.action
          4 kB
        4. View Source.htm
          9 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dcec3d5a7823 Vanessa Roberts
              Votes:
              74 Vote for this issue
              Watchers:
              66 Start watching this issue

              Dates

                Created:
                Updated: