[ARCH-75] Maven archetype doesn't provide updated XML configuration Created: 19/Jan/22  Updated: 22/Apr/22  Resolved: 21/Apr/22

Status: Closed
Project: Archetypes
Component/s: None
Affects Version/s: None
Fix Version/s: 1.4

Type: Bug Priority: Neutral
Reporter: Roberto Gaona Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: Support
Sprint: DevX 8
Story Points: 1
Team: DeveloperX

 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


Generated at Sun Feb 11 23:23:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.