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

NPE in MetadataManager when saxing a CompositeMetadata of a linked content

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.9
    • None
    • None
    • None

      My content has a metadata of type "content" set to a content with a composite metadata "foo" (which have some fields filled).

      On metadata-set "main" of type "view", I precised a metadata-set who does not exist for the metadata of type "content", so all metadata of the linked content will be saxed.

      <cms:metadata-set name="main" type="view">
              ....
              <cms:metadata-ref name="linkedContent" metadata-set="toto"/>
             ....
      </cms:metadata-set>
      

      I have a NPE when viewing my content. The NPE occurs when saxing values of the composite metadata "foo".

      Caused by: java.lang.NullPointerException
      	at org.ametys.cms.contenttype.MetadataManager._saxCompositeMetadata(MetadataManager.java:417)
      	at org.ametys.cms.contenttype.MetadataManager._saxMetadata(MetadataManager.java:296)
      	at org.ametys.cms.contenttype.MetadataManager._saxMetadataSetElementOrAll(MetadataManager.java:225)
      	at org.ametys.cms.contenttype.MetadataManager._saxContentMetadata(MetadataManager.java:617)
      	at org.ametys.cms.contenttype.MetadataManager._saxMetadata(MetadataManager.java:321)
      	at org.ametys.cms.contenttype.MetadataManager._saxMetadataSetElementOrAll(MetadataManager.java:204)
      	at org.ametys.cms.contenttype.MetadataManager._saxMetadataSetElementOrAll(MetadataManager.java:211)
      	at org.ametys.cms.contenttype.MetadataManager.saxMetadata(MetadataManager.java:148)
      	at org.ametys.cms.content.ContentGenerator._saxMetadata(ContentGenerator.java:307)
      	at org.ametys.cms.content.ContentGenerator._saxContent(ContentGenerator.java:138)
      	at org.ametys.cms.content.ContentGenerator._generateContent(ContentGenerator.java:102)
      	at org.ametys.cms.content.ContentGenerator.generate(ContentGenerator.java:86)
      	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:581)
      

            Unassigned Unassigned
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: