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

noformat does not like Unicode above base multilingual plane

    XMLWordPrintable

Details

    Description

      When attempting to paste character literals from above the BMP into a noformat box, confluence generates a runtime error when attempting to save the page. Characters above the BMP are typically stored as two characters in Java, requiring internally the representation using surrogate pairs.

      To reproduce the issue:

      1. create a valid Unicode character above 65535 in a Unicode-capable terminal, i.e. using "perl -CSD -le 'print chr(0x24B24)'"
      2. open a page for editing
      3. start a noformat macro
      4. copy and paste the above (Chinese) character into the box
      5. attempt to save

      I believe that Confluence should be able to handle Unicodes with a code point value above 65535 that are not in the Unicode categories for control (Cc), surrogate (Cs), private-use (Co) or unassigned (Cn).

      The errors returned are:

      Cause

      java.lang.RuntimeException: Error rendering template for decorator root
      at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:186)

      caused by: java.lang.RuntimeException: Error rendering template for decorator page
      at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:186)

      caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getWebInterfaceContext' in class com.atlassian.confluence.pages.actions.EditPageAction threw exception net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection at template/includes/menu-macros.vm[line 67, column 79]
      at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)

      caused by: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection
      at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:201)

      caused by: net.sf.hibernate.HibernateException: collection was evicted
      at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3307)

      Attachments

        Activity

          People

            Unassigned Unassigned
            8e8db8aa71cd Jens-S. Vöckler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: