Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3126

Make new action availability more failsafe - when 'selectedElement' is null this causes NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 5.3.3
    • Component/s: page editor, pages app
    • Labels:
      None
    • Magnolia Release:
      5.3.3

      Description

      MGNLUI-3097 introduced info.magnolia.pages.app.editor.PagesEditorSubApp#prepareAndExecutePagesEditorAction(String actionName). When selectedElement returned by info.magnolia.pages.app.editor.PageEditorPresenter is null this will cause an NPE with the following failure:

      [INFO] [talledLocalContainer] 2014-08-27 13:05:31,800 ERROR info.magnolia.pages.app.editor.PagesEditorSubApp  : An error occurred while executing action [editProperties]
      [INFO] [talledLocalContainer] info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: editProperties
      [INFO] [talledLocalContainer]   at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:64)
      [INFO] [talledLocalContainer]   at info.magnolia.pages.app.editor.PagesEditorSubApp.prepareAndExecutePagesEditorAction(PagesEditorSubApp.java:410)
      [INFO] [talledLocalContainer]   at info.magnolia.pages.app.editor.PagesEditorSubApp.onActionbarItemClicked(PagesEditorSubApp.java:403)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.actionbar.ActionbarPresenter.onActionbarItemClicked(ActionbarPresenter.java:205)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.actionbar.ActionbarViewImpl$1.actionTrigger(ActionbarViewImpl.java:67)
      [INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [INFO] [talledLocalContainer]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [INFO] [talledLocalContainer]   at java.lang.reflect.Method.invoke(Method.java:606)
      [INFO] [talledLocalContainer]   at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
      [INFO] [talledLocalContainer]   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:167)
      [INFO] [talledLocalContainer]   at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:969)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.vaadin.actionbar.Actionbar.access$000(Actionbar.java:59)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.vaadin.actionbar.Actionbar$1.onActionTriggered(Actionbar.java:72)
      [INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      [INFO] [talledLocalContainer]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [INFO] [talledLocalContainer]   at java.lang.reflect.Method.invoke(Method.java:606)
      [INFO] [talledLocalContainer]   at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)
      [INFO] [talledLocalContainer]   at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
      [INFO] [talledLocalContainer]   at com.vaadin.server.communication.ServerRpcHandler.handleBurst(ServerRpcHandler.java:214)
      [INFO] [talledLocalContainer]   at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:111)
      [INFO] [talledLocalContainer]   at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:91)
      [INFO] [talledLocalContainer]   at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37)
      [INFO] [talledLocalContainer]   at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1371)
      [INFO] [talledLocalContainer]   at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.admincentral.AdmincentralVaadinServlet.service(AdmincentralVaadinServlet.java:132)
      [INFO] [talledLocalContainer]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:148)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.VirtualUriFilter.doFilter(VirtualUriFilter.java:68)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.module.cache.executor.Bypass.processCacheRequest(Bypass.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.module.cache.executor.CompositeExecutor.processCacheRequest(CompositeExecutor.java:66)
      [INFO] [talledLocalContainer]   at info.magnolia.module.cache.filter.CacheFilter.doFilter(CacheFilter.java:153)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:73)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.RangeSupportFilter.doFilter(RangeSupportFilter.java:84)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:57)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.security.SecurityCallbackFilter.doFilter(SecurityCallbackFilter.java:83)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:94)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.module.templatingkit.filters.SiteMergeFilter.doFilter(SiteMergeFilter.java:112)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.multisite.filters.MultiSiteFilter.doFilter(MultiSiteFilter.java:106)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MultiChannelFilter.doFilter(MultiChannelFilter.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:73)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:104)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.enterprise.registration.RegistrationFilter.doFilter(RegistrationFilter.java:56)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.module.devicedetection.filter.DeviceDetectionFilter.doFilter(DeviceDetectionFilter.java:71)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.personalization.preview.filter.PreviewFilter.doFilter(PreviewFilter.java:92)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:58)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:82)
      [INFO] [talledLocalContainer]   at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:61)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.personalization.trait.AbstractTraitDetectorFilter.doFilter(AbstractTraitDetectorFilter.java:61)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:103)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.ContextFilter.doFilter(ContextFilter.java:129)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:80)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:89)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper.doFilter(SafeDestroyMgnlFilterWrapper.java:106)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlFilterDispatcher.doDispatch(MgnlFilterDispatcher.java:66)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:107)
      [INFO] [talledLocalContainer]   at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:93)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.Server.handle(Server.java:326)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      [INFO] [talledLocalContainer]   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      [INFO] [talledLocalContainer]   at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      [INFO] [talledLocalContainer]   at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
      [INFO] [talledLocalContainer] Caused by: java.lang.NullPointerException
      [INFO] [talledLocalContainer]   at info.magnolia.objectfactory.CandidateParameterResolver.resolveParameter(CandidateParameterResolver.java:77)
      [INFO] [talledLocalContainer]   at info.magnolia.objectfactory.ObjectManufacturer.resolveParameter(ObjectManufacturer.java:134)
      [INFO] [talledLocalContainer]   at info.magnolia.objectfactory.ObjectManufacturer.resolveParameters(ObjectManufacturer.java:123)
      [INFO] [talledLocalContainer]   at info.magnolia.objectfactory.ObjectManufacturer.newInstance(ObjectManufacturer.java:75)
      [INFO] [talledLocalContainer]   at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstanceWithParameterResolvers(GuiceComponentProvider.java:121)
      [INFO] [talledLocalContainer]   at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstance(GuiceComponentProvider.java:107)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.api.action.AbstractActionExecutor.createAction(AbstractActionExecutor.java:90)
      [INFO] [talledLocalContainer]   at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:61)
      [INFO] [talledLocalContainer]   ... 126 more
      

      The code should take into account that there can be actions that do not require a selected element, such as the openPageProperties action.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fgrilli Federico Grilli
              Reporter:
              pmundt Philip Mundt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: