Details
-
Bug
-
Resolution: Fixed
-
Neutral
-
None
-
3.0.7
-
None
-
None
Description
Hi,
I have a weird problem. It seems to be a bug, but I'm not 100% sure. I need some help with figuring it out though.
java.lang.IllegalStateException: DialogCreationContext not set, dialog cannot be created without it [blossom-area-dialog:project.spring.web.blossom.controllers.templates.HomePageTemplate$StageArea] at info.magnolia.module.blossom.dialog.BlossomDialogDefinitionProvider.getDialogDefinition(BlossomDialogDefinitionProvider.java:67) at info.magnolia.ui.dialog.registry.DialogDefinitionRegistry.register(DialogDefinitionRegistry.java:96) at info.magnolia.module.blossom.template.TemplateExporter.registerAreaDialog(TemplateExporter.java:293) at info.magnolia.module.blossom.template.TemplateExporter.registerAreaDialogs(TemplateExporter.java:270) at info.magnolia.module.blossom.template.TemplateExporter.exportTemplates(TemplateExporter.java:202) at info.magnolia.module.blossom.template.TemplateExporter.onApplicationEvent(TemplateExporter.java:173) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331) at info.magnolia.module.blossom.render.BlossomDispatcherServlet.onRefresh(BlossomDispatcherServlet.java:119) at org.springframework.web.servlet.FrameworkServlet.onApplicationEvent(FrameworkServlet.java:801) at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:1117) at org.springframework.web.servlet.FrameworkServlet$ContextRefreshListener.onApplicationEvent(FrameworkServlet.java:1113) at org.springframework.context.event.GenericApplicationListenerAdapter.onApplicationEvent(GenericApplicationListenerAdapter.java:52) at org.springframework.context.event.SourceFilteringListener.onApplicationEventInternal(SourceFilteringListener.java:100) at org.springframework.context.event.SourceFilteringListener.onApplicationEvent(SourceFilteringListener.java:69) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at info.magnolia.module.blossom.module.BlossomModuleSupport.initDispatcherServlet(BlossomModuleSupport.java:168) at info.magnolia.module.blossom.module.BlossomModuleSupport.initBlossomDispatcherServlet(BlossomModuleSupport.java:127)
As you can see the stack trace contains these lines:
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
, so obviously the web application context is just in the process of getting initialized.
Unfortunately, as part of this it runs through the following lines:
DialogCreationContext context = DialogCreationContextHolder.get();
if (context == null) {
throw new IllegalStateException("DialogCreationContext not set, dialog cannot be created without it [" + dialogDescription.getId() + "]");
}
This very exception is thrown (see stack trace above), because there is no context yet, which seems somehow expected as it is just getting initialized.
Now you might be wondering what I'm trying to do. I think it's quite a normal thing, I'm trying to render an area which is a direct inner class of a @Template controller. The area definition looks pretty much like this:
@Area(value="stage", title="Stage") @Controller public static class StageArea { @RequestMapping("/homepage/stage") public String render(Model model) { return "components/home_stage.jsp"; } @TabFactory("Content") public void contentTab(UiConfig cfg, TabBuilder tab) { tab.fields( cfg.fields.text("headline").label("Headline").rows(3) ); } }
Thanks a lot for giving some input on how to solve this. Googling didn't help.