Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-11288

ContentValue JSON serialization creates a infinite loop

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 4.5.5, 4.6.0
    • 4.5.4
    • None
    • None
    • 4.6 M3

      Content types editor fails on viewing content types with default value on attribute of type "content".

      Date:			Wed Oct 13 13:51:48 CEST 2021 (1634125908109)
      Thread:		http-nio-10002-exec-4
      Message #:	68790
      Level:		ERROR
      NDC:			
      Category:	org.ametys.plugins.core.ui
      Message:		Can not dispatch request '3' : 'core-ui' 'client-call' '{role=org.ametys.core.ui.UIToolsFactoriesManager, id=uitool-contenttypeseditor, methodName=getContentTypeInfos, parameters=[content-type.Structure, false]}'
      Location:	org.apache.cocoon.util.log.SLF4JLoggerAdapter.error(SLF4JLoggerAdapter.java:46)
      Thrown:
      org.apache.cocoon.util.location.LocatedException: Can not dispatch request '3' : 'core-ui' 'client-call' '{role=org.ametys.core.ui.UIToolsFactoriesManager, id=uitool-contenttypeseditor, methodName=getContentTypeInfos, parameters=[content-type.Structure, false]}'
      	at org.ametys.core.ui.dispatcher.DispatchGenerator._dispatching(DispatchGenerator.java:198)
      	at org.ametys.core.ui.dispatcher.DispatchGenerator.generate(DispatchGenerator.java:95)
      	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:581)
      	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:301)
      	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483)
      	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:144)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
      	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
      	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
      	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
      	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:236)
      	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:178)
      	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
      	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
      	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
      	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
      	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
      	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:236)
      	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:178)
      	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
      	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
      	at org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
      	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
      	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
      	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
      	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:236)
      	at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:178)
      	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
      	at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
      	at org.ametys.runtime.servlet.RuntimeServlet.service(RuntimeServlet.java:580)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: org.apache.excalibur.source.SourceException: Exception during processing of cocoon://_plugins/core-ui/client-call?role=org.ametys.core.ui.UIToolsFactoriesManager&id=uitool-contenttypeseditor&methodName=getContentTypeInfos&parameters=content-type.Structure&parameters=false&
      	at org.apache.cocoon.components.source.impl.SitemapSource.getInputStream(SitemapSource.java:277)
      	at org.ametys.core.ui.dispatcher.DispatchGenerator._dispatching(DispatchGenerator.java:157)
      	... 59 more
      Caused by: org.apache.cocoon.ProcessingException: Failed to process reader
      	at <map:read type="json"> - file:/home/grapin/Dev/Ametys/kernel/01_Runtime/master/main/plugin-core-ui/sitemap.xmap:82:48
      	at org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:113)
      	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.handleException(AbstractProcessingPipeline.java:959)
      	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processReader(AbstractCachingProcessingPipeline.java:940)
      	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:475)
      	at org.apache.cocoon.components.source.impl.SitemapSource.getInputStream(SitemapSource.java:267)
      	... 60 more
      Caused by: java.lang.IllegalArgumentException: The object can not be converted to json string
      	at org.ametys.core.util.JSONUtils.convertObjectToJson(JSONUtils.java:213)
      	at org.ametys.core.cocoon.JSonReader.generate(JSonReader.java:61)
      	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processReader(AbstractCachingProcessingPipeline.java:921)
      	... 62 more
      Caused by: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: 
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      [...]
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"]->org.ametys.cms.contenttype.AutomaticContentType["modelItems"]->java.util.Collections$UnmodifiableCollection[0]->
      org.ametys.cms.contenttype.AttributeDefinition["model"])
      	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:785)
      	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
      	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serializeContents(CollectionSerializer.java:145)
      	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:107)
      	at com.fasterxml.jackson.databind.ser.std.CollectionSerializer.serialize(CollectionSerializer.java:25)
      	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
      	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)

            bmaurel Bérénice Maurel
            bmaurel Bérénice Maurel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: