[MGNLUI-1800] Errors in apps breaks admincentral Created: 28/Jun/13  Updated: 05/Dec/14  Resolved: 22/Jul/14

Status: Closed
Project: Magnolia UI
Component/s: app framework
Affects Version/s: 5.0
Fix Version/s: 5.2.8, 5.3.2

Type: Bug Priority: Major
Reporter: Tobias Mattsson Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 1
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When an app encounters a problem, either because of a configuration error, such as starting an app that is not correctly configured or when it throws an exception because of a programming error, admincentral breaks because it gets stalled in app loading mode.

We need a plan for how we deal with this, either just close the app and go back to app launcher, or insert a view that informs the user about the error.

Here's two scenarios in which this happens:

Launching an app that doesn't have any sub apps

java.lang.NullPointerException
	at info.magnolia.ui.framework.app.AppControllerImpl.updateLocation(AppControllerImpl.java:358)
	at info.magnolia.ui.framework.app.AppControllerImpl.onLocationChanged(AppControllerImpl.java:324)
	at info.magnolia.ui.api.location.LocationChangedEvent.dispatch(LocationChangedEvent.java:64)
	at info.magnolia.ui.api.location.LocationChangedEvent.dispatch(LocationChangedEvent.java:42)
	at info.magnolia.event.SimpleEventBus.fireEvent(SimpleEventBus.java:78)
	at info.magnolia.ui.api.location.LocationController.goToWithoutChecks(LocationController.java:105)
	at info.magnolia.ui.api.location.LocationController.goTo(LocationController.java:99)
	at info.magnolia.ui.api.location.LocationHistoryHandler.handleFragment(LocationHistoryHandler.java:120)
	at info.magnolia.ui.api.location.LocationHistoryHandler.access$100(LocationHistoryHandler.java:49)
	at info.magnolia.ui.api.location.LocationHistoryHandler$1.onFragmentChanged(LocationHistoryHandler.java:79)
	at info.magnolia.ui.api.shell.FragmentChangedEvent.dispatch(FragmentChangedEvent.java:55)
	at info.magnolia.ui.api.shell.FragmentChangedEvent.dispatch(FragmentChangedEvent.java:41)
	at info.magnolia.event.EventHandlerCollection.dispatch(EventHandlerCollection.java:72)
	at info.magnolia.ui.framework.shell.ShellImpl$2.onFragmentChanged(ShellImpl.java:132)
	at info.magnolia.ui.vaadin.magnoliashell.MagnoliaShell.notifyOnFragmentChanged(MagnoliaShell.java:272)
	at info.magnolia.ui.framework.shell.ShellImpl.goToApp(ShellImpl.java:263)
	at info.magnolia.ui.framework.shell.ShellImpl.access$500(ShellImpl.java:80)
	at info.magnolia.ui.framework.shell.ShellImpl$2.goToApp(ShellImpl.java:152)
	at info.magnolia.ui.vaadin.magnoliashell.MagnoliaShell.goToApp(MagnoliaShell.java:131)
	at info.magnolia.ui.vaadin.magnoliashell.rpc.MagnoliaShellRpcDelegate.activateApp(MagnoliaShellRpcDelegate.java:68)
	at sun.reflect.GeneratedMethodAccessor278.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
	at com.vaadin.server.AbstractCommunicationManager.handleBurst(AbstractCommunicationManager.java:1680)
	at com.vaadin.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1566)
	at com.vaadin.server.AbstractCommunicationManager.handleUidlRequest(AbstractCommunicationManager.java:582)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:315)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)

Launching an app that has sub apps but no app class set

java.lang.NullPointerException
	at info.magnolia.objectfactory.ObjectManufacturer.newInstance(ObjectManufacturer.java:59)
	at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstanceWithParameterResolvers(GuiceComponentProvider.java:118)
	at info.magnolia.objectfactory.guice.GuiceComponentProvider.newInstance(GuiceComponentProvider.java:108)
	at info.magnolia.ui.framework.app.AppInstanceControllerImpl.start(AppInstanceControllerImpl.java:212)
	at info.magnolia.ui.framework.app.AppControllerImpl.doStartIfNotAlreadyRunning(AppControllerImpl.java:254)
	at info.magnolia.ui.framework.app.AppControllerImpl.onLocationChanged(AppControllerImpl.java:335)
	at info.magnolia.ui.api.location.LocationChangedEvent.dispatch(LocationChangedEvent.java:64)
	at info.magnolia.ui.api.location.LocationChangedEvent.dispatch(LocationChangedEvent.java:42)
	at info.magnolia.event.SimpleEventBus.fireEvent(SimpleEventBus.java:78)
	at info.magnolia.ui.api.location.LocationController.goToWithoutChecks(LocationController.java:105)
	at info.magnolia.ui.api.location.LocationController.goTo(LocationController.java:99)
	at info.magnolia.ui.api.location.LocationHistoryHandler.handleFragment(LocationHistoryHandler.java:120)
	at info.magnolia.ui.api.location.LocationHistoryHandler.access$100(LocationHistoryHandler.java:49)
	at info.magnolia.ui.api.location.LocationHistoryHandler$1.onFragmentChanged(LocationHistoryHandler.java:79)
	at info.magnolia.ui.api.shell.FragmentChangedEvent.dispatch(FragmentChangedEvent.java:55)
	at info.magnolia.ui.api.shell.FragmentChangedEvent.dispatch(FragmentChangedEvent.java:41)
	at info.magnolia.event.EventHandlerCollection.dispatch(EventHandlerCollection.java:72)
	at info.magnolia.ui.framework.shell.ShellImpl$2.onFragmentChanged(ShellImpl.java:132)
	at info.magnolia.ui.vaadin.magnoliashell.MagnoliaShell.notifyOnFragmentChanged(MagnoliaShell.java:272)
	at info.magnolia.ui.framework.shell.ShellImpl.goToApp(ShellImpl.java:263)
	at info.magnolia.ui.framework.shell.ShellImpl.access$500(ShellImpl.java:80)
	at info.magnolia.ui.framework.shell.ShellImpl$2.goToApp(ShellImpl.java:152)
	at info.magnolia.ui.vaadin.magnoliashell.MagnoliaShell.goToApp(MagnoliaShell.java:131)
	at info.magnolia.ui.vaadin.magnoliashell.rpc.MagnoliaShellRpcDelegate.activateApp(MagnoliaShellRpcDelegate.java:68)
	at sun.reflect.GeneratedMethodAccessor278.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)
	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
	at com.vaadin.server.AbstractCommunicationManager.handleBurst(AbstractCommunicationManager.java:1680)
	at com.vaadin.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1566)
	at com.vaadin.server.AbstractCommunicationManager.handleUidlRequest(AbstractCommunicationManager.java:582)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:315)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:201)

Launching a content app with none of the configured content views set as "active" will break the admin central:

2013-07-08 17:03:33,492 WARN  info.magnolia.event.SimpleEventBus                : Exception caught when dispatching event: null
java.lang.NullPointerException
	at info.magnolia.ui.workbench.WorkbenchPresenter.setViewType(WorkbenchPresenter.java:165)
	at info.magnolia.ui.workbench.WorkbenchPresenter.resynch(WorkbenchPresenter.java:247)
	at info.magnolia.ui.contentapp.browser.BrowserPresenter.resync(BrowserPresenter.java:239)
	at info.magnolia.ui.contentapp.browser.BrowserSubApp.restoreBrowser(BrowserSubApp.java:209)

info.magnolia.ui.workbench.WorkbenchPresenter#start
we should not rely on a property called "active" (meaning default?). Instead we should use the first configured contentview as default. Same pattern we are using for the configured sub apps



 Comments   
Comment by Aleksandr Pchelintcev [ 23/Jul/14 ]

The fix provided is supposed to prevent admin central from breaking in a generic case of the app/sub-app start-up failure. The aforementioned problems are just the concrete cases of such failures.

It is also worth mentioning that I failed to re-produce the third issue ("Launching a content app with none of the configured content views set as "active" will break the admin central").

Generated at Mon Feb 12 08:50:15 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.