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

Node2Bean should not try to instantiate enumerations, which causes an exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Neutral
    • Resolution: Unresolved
    • Affects Version/s: 5.3.1
    • Fix Version/s: None
    • Component/s: node2bean
    • Labels:
      None

      Description

      To reproduce:

      1. In Config App, go to /modules/standard-templating-kit/dialogs/pages/forum/stkForumHeader
      2. Create a content node named "modalityLevel", which is a field mapped to an enum in the bean
      3. See that N2B actually tries to instantiate it as a bean, causing an exception
      2014-08-18 16:56:40,619 WARN  magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl: Can't instantiate bean for /modules/standard-templating-kit/dialogs/pages/forum/stkForumHeader/modalityLevel
      info.magnolia.jcr.node2bean.Node2BeanException: info.magnolia.objectfactory.MgnlInstantiationException: No suitable constructor found for class [class info.magnolia.ui.api.overlay.OverlayLayer$ModalityLevel]
      	at info.magnolia.jcr.node2bean.impl.Node2BeanTransformerImpl.newBeanInstance(Node2BeanTransformerImpl.java:261)
      	at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:135)
      	at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toMap(Node2BeanProcessorImpl.java:227)
      	at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:132)
      	at info.magnolia.jcr.node2bean.impl.Node2BeanProcessorImpl.toBean(Node2BeanProcessorImpl.java:94)
      	at info.magnolia.ui.dialog.registry.ConfiguredDialogDefinitionProvider.<init>(ConfiguredDialogDefinitionProvider.java:58)
      	at info.magnolia.ui.dialog.registry.ConfiguredDialogDefinitionManager.createProvider(ConfiguredDialogDefinitionManager.java:123)
      	at info.magnolia.ui.dialog.registry.ConfiguredDialogDefinitionManager$1.visit(ConfiguredDialogDefinitionManager.java:93)
      	at info.magnolia.jcr.util.NodeUtil.visit(NodeUtil.java:656)
      	at info.magnolia.jcr.util.NodeUtil.visit(NodeUtil.java:658)
      	at info.magnolia.jcr.util.NodeUtil.visit(NodeUtil.java:658)
      	at info.magnolia.ui.dialog.registry.ConfiguredDialogDefinitionManager.reload(ConfiguredDialogDefinitionManager.java:85)
      	at info.magnolia.cms.util.ModuleConfigurationObservingManager.reload(ModuleConfigurationObservingManager.java:98)
      	at info.magnolia.cms.util.WorkspaceObservingManager$1$1.doExec(WorkspaceObservingManager.java:90)
      	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:414)
      	at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:411)
      	at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:385)
      	at info.magnolia.cms.util.WorkspaceObservingManager$1.onEvent(WorkspaceObservingManager.java:86)
      	at info.magnolia.cms.util.ObservationUtil$ObservationBasedDelayedExecutor$1.run(ObservationUtil.java:253)
      	at info.magnolia.cms.util.DelayedExecutor$RunnableWrapper.run(DelayedExecutor.java:103)
      	at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(Unknown Source)
      	at java.lang.Thread.run(Thread.java:695)
      Caused by: info.magnolia.objectfactory.MgnlInstantiationException: No suitable constructor found for class [class info.magnolia.ui.api.overlay.OverlayLayer$ModalityLevel]
      	at info.magnolia.objectfactory.ObjectManufacturer.newInstance(ObjectManufacturer.java:104)
      	at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstanceWithParameterResolvers(GuiceComponentProvider.java:121)
      	at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstance(GuiceComponentProvider.java:107)
      	at info.magnolia.jcr.node2bean.impl.Node2BeanTransformerImpl.newBeanInstance(Node2BeanTransformerImpl.java:259)
      	... 21 more
      

        Checklists

        Acceptance criteria

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                cheng.hu Cheng Hu
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    Checklists

                    Bug DoR
                    DoD