Ant-Media-Server
Ant-Media-Server copied to clipboard
List of applications not showing up on Admin UI if a plugin throws unhandled exception during init
Short description
Upon unhandled exceptions occuring in plugin beans that implement ApplicationContextAware interface, the streaming application initialization fails and the Admin UI does not list the application on the left hand side menu and the user can only dig out the problem from the logs.
While plugin developers can do their best on the error handling front, it would be desirable if AMS itself could do as much defensive coding as possible, being prepared for third party plugins and applications to have flaws and handle them so that at least the application still gets listed on the UI and an error message indicates to the user to check the logs for more details.
Environment
- Operating system and version: Ubuntu, n/a
- Java version: n/a
- Ant Media Server version: 2.5.0
- Browser name and version: n/a
Steps to reproduce
- Create a plugin where an arbitrary exception is thrown from a bean that implements ApplicationContextAware
LiveAppwon't show up on the administration UI
Expected behavior
- Keep the list of applications complete, but indicate initialization error on the UI and advise the user to check the logs
Actual behavior
- No applications get listed on the admin UI and users get confused about the root cause
- The logs show an exception, such as the below example:
Caused by: com.typesafe.config.ConfigException$Parse: /usr/local/antmedia/conf/stamp.conf: 1:
at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(ConfigDocumentParser.java:201)
at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(ConfigDocumentParser.java:197)
at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseObject(ConfigDocumentParser.java:461)
at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parse(ConfigDocumentParser.java:648)
at com.typesafe.config.impl.ConfigDocumentParser.parse(ConfigDocumentParser.java:14)
at com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:262)
at com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:250)
at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180)
at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
at com.typesafe.config.impl.Parseable.parse(Parseable.java:301)
at com.typesafe.config.ConfigFactory.parseFile(ConfigFactory.java:793)
at com.typesafe.config.ConfigFactory.parseApplicationReplacement(ConfigFactory.java:1166)
at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:11)
at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:532)
at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:264)
at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:261)
at com.typesafe.config.impl.ConfigImpl$LoaderCache.getOrElseUpdate(ConfigImpl.java:66)
at com.typesafe.config.impl.ConfigImpl.computeCachedConfig(ConfigImpl.java:93)
at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:261)
at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:237)
at io.antmedia.plugin.stamp.Configuration.<init>(Configuration.java:40)
at io.antmedia.plugin.StampPlugin.initialize(StampPlugin.java:144)
at io.antmedia.plugin.StampPlugin.initComponents(StampPlugin.java:94)
at io.antmedia.plugin.StampPlugin.setApplicationContext(StampPlugin.java:81)
at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:128)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:102)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
... 9 more
Logs
Place logs on pastebin or elsewhere and put links here
Join community.antmedia.io and be a part of Ant Media Server Community.