Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3190

Freemarker: incomplete configuration of sharedVariables results in StackOverflowError

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.3.2
    • 4.3.1
    • freemarker
    • None

    Description

      While configuring /server/rendering/freemarker/sharedVariables, one can enter an endless loop, quickly resulting in a StackOverflowError; this happens, for instance, when adding a node under sharedVariables, and not filling it in it with a class attribute. The error only shows up on startup, so if the configuration is complete and correct before restarting Magnolia, one should be safe.

      The reason this happens is because FreemarkerConfig#addSharedVariable needs an instance of ObjectWrapper, and in turns, our MagnoliaObjectWrapper needs an instance of FreemarkerConfig, which it gets via Components Since Content2Bean calls addSharedVariable() before FreemarkerConfig is registered in Components, this results in a stack overflow.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                gjoseph Magnolia International
                gjoseph Magnolia International
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD