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

Running OSGi command to tag existing assets throws exception when auto tagging text

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: Master
    • Fix Version/s: None
    • Component/s: DM
    • Labels:
      None
    • Fix Priority:
      4

      Description

      Steps to reproduce:

      1. Navigate to DM library > upload multiple text assets in different file formats (.docx, .doc, .pdf, .odt, .txt, etc)
        • Assert no tags
      2. Navigate to Control Panel > Configuration > System Settings > Documents and Media
        • Enable OpenNLP Document Tagging > Save
      3. Navigate to Control Panel > Configuration > Virtual Instances
        • Note Instance ID
      4. Navigate to Control Panel > Configuration > Gogo Shell
      5. Run the OSGi auto tagging command:
        • assetAutoTagger:tagAllUntagged InstanceID

      Expected Result:
      Existing text assets should be tagged, similar to image tagging described in UC-662; note that not all files will be tagged if the tagging service does not find an appropriate tag.

      Actual Result:
      .docx assets were tagged, the rest of the uploaded files were not tagged and console errors were present:

      2019-04-05 16:50:11.591 ERROR [pipe-assetAutoTagger:tagAllUntagged 20101][JDBCExceptionReporter:234] data exception: string data, right truncation;  table: ASSETTAG column: NAME
      2019-04-05 16:50:11.600 ERROR [pipe-assetAutoTagger:tagAllUntagged 20101][AssetAutoTaggerOSGiCommands:160] com.liferay.portal.kernel.exception.PortalException: Unable to auto tag asset entry 37049
      com.liferay.portal.kernel.exception.PortalException: Unable to auto tag asset entry 37049
              at com.liferay.asset.auto.tagger.internal.AssetAutoTaggerImpl.tag(AssetAutoTaggerImpl.java:156)
              at com.liferay.asset.auto.tagger.internal.osgi.commands.AssetAutoTaggerOSGiCommands.lambda$tagAllUntagged$0(AssetAutoTaggerOSGiCommands.java:91)
              at com.liferay.asset.auto.tagger.internal.osgi.commands.AssetAutoTaggerOSGiCommands.lambda$_forEachAssetEntry$3(AssetAutoTaggerOSGiCommands.java:155)
              at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performAction(DefaultActionableDynamicQuery.java:404)
              at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery$1.call(DefaultActionableDynamicQuery.java:316)
              at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery$1.call(DefaultActionableDynamicQuery.java:278)
              at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.doPerformActions(DefaultActionableDynamicQuery.java:336)
              at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performActions(DefaultActionableDynamicQuery.java:86)
              at com.liferay.asset.auto.tagger.internal.osgi.commands.AssetAutoTaggerOSGiCommands._forEachAssetEntry(AssetAutoTaggerOSGiCommands.java:157)
              at com.liferay.asset.auto.tagger.internal.osgi.commands.AssetAutoTaggerOSGiCommands.tagAllUntagged(AssetAutoTaggerOSGiCommands.java:82)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:139)
              at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
              at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
              at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
              at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
              at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416)
              at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
              at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at com.liferay.portlet.asset.service.persistence.impl.AssetTagFinderImpl.countByG_C_N(AssetTagFinderImpl.java:131)
              at com.liferay.portlet.asset.service.impl.AssetTagLocalServiceImpl.getTagsSize(AssetTagLocalServiceImpl.java:568)
              at sun.reflect.GeneratedMethodAccessor623.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
              at com.sun.proxy.$Proxy1619.getTagsSize(Unknown Source)
              at com.liferay.asset.kernel.service.AssetTagLocalServiceWrapper.getTagsSize(AssetTagLocalServiceWrapper.java:823)
              at sun.reflect.GeneratedMethodAccessor623.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
              at com.sun.proxy.$Proxy1620.getTagsSize(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor623.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.lambda$invoke$0(TransactionInterceptor.java:64)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:62)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
              at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
              at com.sun.proxy.$Proxy45.getTagsSize(Unknown Source)
              at com.liferay.asset.tag.stats.service.impl.AssetTagStatsLocalServiceImpl.updateTagStats(AssetTagStatsLocalServiceImpl.java:199)
              at sun.reflect.GeneratedMethodAccessor625.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.lambda$invoke$0(TransactionInterceptor.java:64)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:62)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
              at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
              at com.sun.proxy.$Proxy809.updateTagStats(Unknown Source)
              at com.liferay.asset.tags.internal.service.AssetTagStatsAssetTagLocalServiceWrapper.incrementAssetCount(AssetTagStatsAssetTagLocalServiceWrapper.java:68)
              at sun.reflect.GeneratedMethodAccessor621.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:66)
              at com.sun.proxy.$Proxy1620.incrementAssetCount(Unknown Source)
              at sun.reflect.GeneratedMethodAccessor621.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.lambda$invoke$0(TransactionInterceptor.java:64)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:62)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
              at com.liferay.portal.kernel.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:65)
              at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
              at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
              at com.sun.proxy.$Proxy45.incrementAssetCount(Unknown Source)
              at com.liferay.asset.auto.tagger.internal.AssetAutoTaggerImpl.lambda$tag$0(AssetAutoTaggerImpl.java:128)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
              at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39)
              at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
              at com.liferay.asset.auto.tagger.internal.AssetAutoTaggerImpl.tag(AssetAutoTaggerImpl.java:92)
              ... 25 more
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:39)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.iterate(SQLQueryImpl.java:146)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.iterate(SQLQueryImpl.java:134)
              at com.liferay.portlet.asset.service.persistence.impl.AssetTagFinderImpl.countByG_C_N(AssetTagFinderImpl.java:118)
              ... 85 more
      Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:39)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:188)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:168)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.iterate(SQLQueryImpl.java:141)
              ... 87 more
      Caused by: org.hibernate.exception.DataException: Could not execute JDBC batch update
              at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:102)
              at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
              at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
              at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
              at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
              at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
              at com.liferay.portal.dao.orm.hibernate.event.NestableAutoFlushEventListener.onAutoFlush(NestableAutoFlushEventListener.java:69)
              at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1185)
              at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1837)
              at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
              at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
              at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:176)
              ... 89 more
      Caused by: java.sql.BatchUpdateException: data exception: string data, right truncation;  table: ASSETTAG column: NAME
              at org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch(JDBCPreparedStatement.java:1937)
              at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:125)
              at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
              at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
              at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
              ... 98 more
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  14 weeks, 5 days ago

                  Packages

                  Version Package