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

VerifyJournal: Unable to update content exception after looking for a JournalArticleImage

    Details

      Description

      Steps to reproduce it:

      1. Create an structure with an image field and a text field inside the image field.
      2. Create a template for that structure
      3. Create a web content using that structure adding just a text, NOT an image.
      4. Restart the server including the following properties:
        verify.processes=com.liferay.portal.verify.VerifyJournal
        verify.frequency=-1

      The following exception will be displayed:

      10:03:29,016 INFO  [localhost-startStop-1][VerifyProcess:69] Verifying com.liferay.portal.verify.VerifyJournal
      10:03:37,925 ERROR [localhost-startStop-1][VerifyJournal:600] Unable to update content for article 20702
      com.liferay.portlet.journal.NoSuchArticleImageException: No JournalArticleImage exists with the primary key 0
      	at com.liferay.portlet.journal.service.persistence.impl.JournalArticleImagePersistenceImpl.findByPrimaryKey(JournalArticleImagePersistenceImpl.java:2543)
      	at com.liferay.portlet.journal.service.persistence.impl.JournalArticleImagePersistenceImpl.findByPrimaryKey(JournalArticleImagePersistenceImpl.java:2560)
      	at com.liferay.portlet.journal.service.impl.JournalArticleImageLocalServiceImpl.getArticleImage(JournalArticleImageLocalServiceImpl.java:121)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:149)
      	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
      	at com.sun.proxy.$Proxy186.getArticleImage(Unknown Source)
      	at com.liferay.portlet.journal.service.JournalArticleImageLocalServiceUtil.getArticleImage(JournalArticleImageLocalServiceUtil.java:221)
      	at com.liferay.portal.verify.VerifyJournal.updateImageElement(VerifyJournal.java:293)
      	at com.liferay.portal.verify.VerifyJournal.updateDynamicElements(VerifyJournal.java:260)
      	at com.liferay.portal.verify.VerifyJournal.updateDynamicElements(VerifyJournal.java:236)
      	at com.liferay.portal.verify.VerifyJournal$6.performAction(VerifyJournal.java:597)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performAction(BaseActionableDynamicQuery.java:372)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery$1.call(BaseActionableDynamicQuery.java:271)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery$1.call(BaseActionableDynamicQuery.java:259)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.doPerformActions(BaseActionableDynamicQuery.java:290)
      	at com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.performActions(BaseActionableDynamicQuery.java:90)
      	at com.liferay.portal.verify.VerifyJournal.verifyArticleStructures(VerifyJournal.java:609)
      	at com.liferay.portal.verify.VerifyJournal.doVerify(VerifyJournal.java:86)
      	at com.liferay.portal.verify.VerifyProcess.verify(VerifyProcess.java:72)
      	at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:111)
      	at com.liferay.portal.verify.VerifyProcessUtil._verifyProcess(VerifyProcessUtil.java:76)
      	at com.liferay.portal.verify.VerifyProcessUtil.verifyProcess(VerifyProcessUtil.java:46)
      	at com.liferay.portal.events.StartupHelper.verifyProcess(StartupHelper.java:175)
      	at com.liferay.portal.events.StartupHelperUtil.verifyProcess(StartupHelperUtil.java:87)
      	at com.liferay.portal.tools.DBUpgrader.verify(DBUpgrader.java:240)
      	at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:192)
      	at com.liferay.portal.events.StartupAction.run(StartupAction.java:67)
      	at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1253)
      	at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:202)
      	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Technical note
      VerifyJournal expects an XML like:

      	<dynamic-element name="Image" type="image" index-type="keyword" index="0" instance-id="ccvh">
      		<dynamic-element name="Enlace" index="0" instance-id="nekv" type="text" index-type="keyword">
      			<dynamic-content language-id="en_US"><![CDATA[dsadsadsa]]></dynamic-content>
      		</dynamic-element>
      		<dynamic-content language-id="en_US" id="XXX"></dynamic-content>
      	</dynamic-element>
      

      but the XML generated is something like:

      	<dynamic-element name="Image" type="image" index-type="keyword" index="0" instance-id="ccvh">
      		<dynamic-element name="Enlace" index="0" instance-id="nekv" type="text" index-type="keyword">
      			<dynamic-content language-id="en_US"><![CDATA[dsadsadsa]]></dynamic-content>
      		</dynamic-element>
      		<dynamic-content language-id="en_US"></dynamic-content>
      	</dynamic-element>
      

      So it can't find the field ID for the tag <dynamic-content

      We shouldn't throw an exception in this case since this causes that we don't update the rest of the fields.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              beck.liu Beck Liu
              Reporter:
              alberto.chaparro Alberto Chaparro
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 39 weeks ago

                  Packages

                  Version Package
                  6.2.4 CE GA5
                  6.2.X EE
                  7.0.0 M5