Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-8399

When select a large section of text on a page an create an annotation, a FAILED messages is displayed when you press the ADD ANNOTATION button.

    Details

    • keywords:
      annotations
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      If you select a large section of text on a page an create an annotation, when you press the ADD ANNOTATION button, a red FAILED message is displayed. If you look in the logs, you will se the exception:

      ...
      2012-01-19 14:53:26,146 [http://take5.azorescorp.com:8080/rest/wikis/xwiki/spaces/Azores+Software+Group/pages/AmandaBackups/annotations?media=json] WARN  o.h.u.JDBCExceptionReporter    - SQL Error: 1406, SQLState: 22001
      2012-01-19 14:53:26,146 [http://take5.azorescorp.com:8080/rest/wikis/xwiki/spaces/Azores+Software+Group/pages/AmandaBackups/annotations?media=json] ERROR o.h.u.JDBCExceptionReporter    - Data truncation: Data too long for column 'XWR_COMMENT' at row 1
      Jan 19, 2012 2:53:26 PM org.xwiki.annotation.rest.internal.AnnotationsRESTResource doPostAnnotation
      SEVERE: An exception occurred when accessing the storage services
      ...
      

      This is a result of the table definition:

      CREATE TABLE `xwikircs` (
        `XWR_DOCID` bigint(20) NOT NULL,
        `XWR_VERSION1` int(11) NOT NULL,
        `XWR_VERSION2` int(11) NOT NULL,
        `XWR_DATE` datetime NOT NULL,
        `XWR_COMMENT` varchar(255) NOT NULL,
        `XWR_AUTHOR` varchar(255) NOT NULL,
        `XWR_ISDIFF` bit(1) DEFAULT NULL,
        `XWR_PATCH` longtext,
        PRIMARY KEY (`XWR_DOCID`,`XWR_VERSION1`,`XWR_VERSION2`),
        KEY `REV_DATE` (`XWR_DATE`),
        KEY `REV_AUTHOR` (`XWR_AUTHOR`),
        KEY `REV_ISDIFF` (`XWR_ISDIFF`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
      

      The XWR_COMMENT column is only 255 characters; however, xwiki is trying to assign to this column the text:

      	Added annotation on " <selected text>"
      

      Which can easily exceed 255 characters.

      Either the comments needs to be truncated, or the column should be defined as a CLOB.

      It turns out that the annotation is saved – when the page is reloaded, the text is highlighted and the annotation text is available.

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              fredtwd Robert Pollina
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: