Uploaded image for project: 'Archetypes'
  1. Archetypes
  2. ARCH-75

Maven archetype doesn't provide updated XML configuration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 1.4
    • None
    • None

    Description

      Steps to reproduce

      1. Create a new Blossom module from the Maven archetype
      2. Set it to use the XML configuration instead of the Java one (default)
      3. Initialize the Magnolia instance

      Expected results

      Module can be loaded and installed without issues.

      Actual results

      Errors appear when trying to initialize Blossom:

      022-01-19 13:28:49,417 INFO  lia.module.blossom.render.BlossomDispatcherServlet: Initializing Servlet 'blossom'
      2022-01-19 13:28:50,590 WARN  ework.web.context.support.XmlWebApplicationContext: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'info.magnolia.module.blossom.view.TemplateViewResolver#0' defined in class path resource [blossom-servlet.xml]: Cannot create inner bean 'info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer#54193a3f' of type [info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer] while setting bean property 'viewRenderer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer#54193a3f' defined in class path resource [blossom-servlet.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'info.magnolia.freemarker.FreemarkerHelper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
      2022-01-19 13:28:50,591 ERROR lia.module.blossom.render.BlossomDispatcherServlet: Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'info.magnolia.module.blossom.view.TemplateViewResolver#0' defined in class path resource [blossom-servlet.xml]: Cannot create inner bean 'info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer#54193a3f' of type [info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer] while setting bean property 'viewRenderer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer#54193a3f' defined in class path resource [blossom-servlet.xml]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'info.magnolia.freemarker.FreemarkerHelper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} 

      Workaround

      This can be solved by manually changing the following bean 

      info.magnolia.module.blossom.view.FreemarkerTemplateViewRenderer

      to the one mentioned on the 3.4.0 changes:

      FreemarkerTemplateViewRendererFactoryBean

      Once changed, the module can be installed without issues.

      Development notes

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              jsimak Jaroslav Simak
              rgaona Roberto Gaona
              DeveloperX
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD