Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-77842

Repository table cannot add rows with long names



      The Repository table in the database has both a name and portletId column, and Liferay at times expects to put the same value in both columns. However, with long portletId's (which have a limit of 200 characters), adding a row will fail because the name column can only hold 75 characters.

      Steps to reproduce:

      1. Start up a clean bundle of Liferay and navigate to localhost:8080/api/jsonws, and log in
      2. Query the database to get the classNameId for the LiferayRepository class from the ClassName_ table ("SELECT mvccversion, classnameid, value FROM classname_ WHERE value like '%LiferayRepository';")
        • Note: in master, this does not always get generated in the ClassName_ table on startup, and it may need to be forced. To do this, go to Control Panel -> Server Administration -> Script, and run the following one-line Groovy script: com.liferay.portal.kernel.service.ClassNameLocalServiceUtil.addClassName("com.liferay.portal.repository.liferayrepository.LiferayRepository")
      3. Navigate to the /repository/add-repository API
      4. Enter the following for each field:
        • groupId: 20142 (may be different; query the Group_ table for the groupId for the guest site to be sure)
        • classNameId: <classNameId for LiferayRepository class>
        • parentFolderId: 0
        • name: abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz
        • Description: a
          • Cannot be left blank, or it will be interpreted as null and throw an error
        • portletId: abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz.abcdefghijklmnopqrstuvwxyz
        • typeSettingsProperties: com.liferay.portal.kernel.util.UnicodeProperties
      5. Click "Invoke"
        Expected result: a Repository object is returned and a row is successfully added to the database
        Actual result: the call fails, with an error thrown in the console like the following:
      18:46:55,893 ERROR [http-nio-8080-exec-8][JSONWebServiceServiceAction:97] Could not execute JDBC batch update; SQL [insert into Repository (mvccVersion, uuid_, groupId, companyId, userId, userName, createDate, modifiedDate, classNameId, name, description, portletId, typeSettings, dlFolderId, lastPublishDate, repositoryId) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.DataException: Could not execute JDBC batch update


          Issue Links



              sharry.shi Sharry Shi
              alec.shay Alec Shay
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              0 Vote for this issue
              1 Start watching this issue


                Days since last comment:
                3 years, 24 weeks, 1 day ago


                  Version Package
                  7.0.0 DXP FP50
                  7.0.0 DXP SP8
                  7.1.0 Beta 1