Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9852

Enlinkd startup fails due to NPE in BroadcastDomain class

    XMLWordPrintable

    Details

    • Sprint:
      Horizon - May 2nd 2018, Horizon - May 9th 2018

      Description

      Looks like a straightforward case of not defending against nulls. Full exception stack trace from output.log:

       

      An error occurred while attempting to start the "OpenNMS:Name=EnhancedLinkd" service (class org.opennms.netmgt.enlinkd.jmx.EnhancedLinkd).  Shutting down and exiting.
      javax.management.RuntimeMBeanException: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [enhancedLinkdContext], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enhancedLinkdContext' defined in URL [jar:file:/opt/opennms/lib/opennms-services-2017.1.4.jar!/beanRefContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daemon' defined in class path resource [META-INF/opennms/applicationContext-enhancedLinkd.xml]: Invocation of init method failed; nested exception is java.lang.Nul lPointerException
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:839)
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:852)
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:821)
              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
              at org.opennms.netmgt.vmmgr.Invoker.invoke(Invoker.java:277)
              at org.opennms.netmgt.vmmgr.Invoker.invokeMethods(Invoker.java:206)
              at org.opennms.netmgt.vmmgr.Starter.start(Starter.java:154)
              at org.opennms.netmgt.vmmgr.Starter.startDaemon(Starter.java:94)
              at org.opennms.netmgt.vmmgr.Controller.start(Controller.java:173)
              at org.opennms.netmgt.vmmgr.Controller.main(Controller.java:150)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at org.opennms.bootstrap.Bootstrap$4.run(Bootstrap.java:525)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [enhancedLinkdContext], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enhancedLinkdContext' defined in URL [jar:file:/opt/opennms/lib/opennms-services-2017.1.4.jar!/beanRefContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daemon' defined in class path resource [META-INF/opennms/applicationContext-enhancedLinkd.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
              at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:404)
              at org.opennms.core.spring.BeanUtils.getBeanFactory(BeanUtils.java:80)
              at org.opennms.core.spring.BeanUtils.getFactory(BeanUtils.java:132)
              at org.opennms.netmgt.daemon.AbstractSpringContextJmxServiceDaemon$1.run(AbstractSpringContextJmxServiceDaemon.java:103)
              at org.opennms.core.logging.Logging.withPrefix(Logging.java:71)
              at org.opennms.netmgt.daemon.AbstractSpringContextJmxServiceDaemon.init(AbstractSpringContextJmxServiceDaemon.java:96)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
              at sun.reflect.GeneratedMethodAccessor285.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
              at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
              at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
              at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
              at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
              ... 13 more
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enhancedLinkdContext' defined in URL [jar:file:/opt/opennms/lib/opennms-services-2017.1.4.jar!/beanRefContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daemon' defined in class path resource [META-INF/opennms/applicationContext-enhancedLinkd.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
              at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:962)
              at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:396)
              ... 33 more
      Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daemon' defined in class path resource [META-INF/opennms/applicationContext-enhancedLinkd.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267)
              ... 43 more
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daemon' defined in class path resource [META-INF/opennms/applicationContext-enhancedLinkd.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
              at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
              at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:105)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
              ... 45 more
      Caused by: java.lang.NullPointerException
              at org.opennms.netmgt.model.topology.BroadcastDomain.printTopologyFromLevel(BroadcastDomain.java:507)
              at org.opennms.netmgt.model.topology.BroadcastDomain.printTopologyFromLevel(BroadcastDomain.java:521)
              at org.opennms.netmgt.model.topology.BroadcastDomain.printTopologyFromLevel(BroadcastDomain.java:521)
              at org.opennms.netmgt.model.topology.BroadcastDomain.printTopology(BroadcastDomain.java:487)
              at org.opennms.netmgt.enlinkd.EnhancedLinkd.onInit(EnhancedLinkd.java:129)
              at org.opennms.netmgt.daemon.AbstractServiceDaemon$1.run(AbstractServiceDaemon.java:226)
              at org.opennms.core.logging.Logging.withPrefix(Logging.java:71)
              at org.opennms.netmgt.daemon.AbstractServiceDaemon.init(AbstractServiceDaemon.java:220)
              at org.opennms.netmgt.daemon.AbstractServiceDaemon.afterPropertiesSet(AbstractServiceDaemon.java:52)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
              ... 61 more

        Attachments

          Activity

            People

            • Assignee:
              cpape Christian Pape
              Reporter:
              jeffg Jeff Gehlbach
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: