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

Config tester doesn't detect missing xml datacollection file

    XMLWordPrintable

    Details

    • Sprint:
      Horizon 2019 - October 23rd, Horizon 2019 - October 30th

      Description

      When a xml datacollection config is missing, ONMS won't start if it's referenced in collectd and xml-datacollection-config. This is a normal behaviour I guess.
      But config-tester doesn't find this issue and ONMS won't start in this case.

      Config-tester should be improved to find this kind of issues.

      [INFO] Successfully loaded jicmp library.
      [DEBUG] System property 'opennms.library.jicmp6' set to '/usr/lib/jni/libjicmp6.so.  Attempting to load jicmp6 library from this location.
      [INFO] Successfully loaded jicmp6 library.
      Oct 05, 2018 8:57:30 AM org.hibernate.validator.internal.util.Version <clinit>
      INFO: HV000001: Hibernate Validator 4.3.2.Final
      An error occurred while attempting to start the "OpenNMS:Name=Eventd" service (class org.opennms.netmgt.eventd.jmx.Eventd).  Shutting down and exiting.
      javax.management.RuntimeMBeanException: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [eventDaemonContext], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventDaemonContext' defined in URL [jar:file:/usr/share/opennms/lib/org.opennms.features.events.daemon-22.0.2.jar!/beanRefContext.xml]: Cannot resolve reference to bean 'daoContext' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoContext' defined in URL [jar:file:/usr/share/opennms/lib/opennms-dao-22.0.2.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 'xmlDataCollectionConfigDao' defined in URL [jar:file:/usr/share/opennms/lib/org.opennms.protocols.xml-22.0.2.jar!/META-INF/opennms/component-dao.xml]: Invocation of init method failed; nested exception is org.opennms.core.xml.MarshallingResourceFailureException: Failed to perform IO while getting a configuration resource from spring: java.io.FileNotFoundException: /usr/share/opennms/etc/xml-datacollection/psp.pro.realtime.e2e.xml (No such file or directory); nested exception is java.io.FileNotFoundException: /usr/share/opennms/etc/xml-datacollection/psp.pro.realtime.e2e.xml (No such file or directory)
              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:498)
              at org.opennms.bootstrap.Bootstrap$4.run(Bootstrap.java:525)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [eventDaemonContext], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventDaemonContext' defined in URL [jar:file:/usr/share/opennms/lib/org.opennms.features.events.daemon-22.0.2.jar!/beanRefContext.xml]: Cannot resolve reference to bean 'daoContext' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoContext' defined in URL [jar:file:/usr/share/opennms/lib/opennms-dao-22.0.2.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 'xmlDataCollectionConfigDao' defined in URL [jar:file:/usr/share/opennms/lib/org.opennms.protocols.xml-22.0.2.jar!/META-INF/opennms/component-dao.xml]: Invocation of init method failed; nested exception is org.opennms.core.xml.MarshallingResourceFailureException: Failed to perform IO while getting a configuration resource from spring: java.io.FileNotFoundException: /usr/share/opennms/etc/xml-datacollection/psp.pro.realtime.e2e.xml (No such file or directory); nested exception is java.io.FileNotFoundException: /usr/share/opennms/etc/xml-datacollection/psp.pro.realtime.e2e.xml (No such file or directory)
              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:498)
              at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
              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:498)
              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 'eventDaemonContext' defined in URL [jar:file:/usr/share/opennms/lib/org.opennms.features.events.daemon-22.0.2.jar!/beanRefContext.xml]: Cannot resolve reference to bean 'daoContext' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoContext' defined in URL [jar:file:/usr/share/opennms/lib/opennms-dao-22.0.2.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 'xmlDataCollectionConfigDao' defined in URL [jar:file:/usr/share/opennms/lib/org.opennms.protocols.xml-22.0.2.jar!/META-INF/opennms/component-dao.xml]: Invocation of init method failed; nested exception is org.opennms.core.xml.MarshallingResourceFailureException: Failed to perform IO while getting a configuration resource from spring: java.io.FileNotFoundException: /usr/share/opennms/etc/xml-datacollection/psp.pro.realtime.e2e.xml (No such file or directory); nested exception is java.io.FileNotFoundException: /usr/share/opennms/etc/xml-datacollection/psp.pro.realtime.e2e.xml (No such file or directory)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
              at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1148)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
              at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1064)
              at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:396)
              ... 34 more
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                patrick.schweizer Patrick Schweizer
                Reporter:
                fuhrmann Marcel Fuhrmann
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: