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

Duty schedules with embedded newlines break startup

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Meridian-2017.1.1
    • Fix Version/s: 21.0.1, Meridian-2017.1.2
    • Component/s: Architecture
    • Security Level: Default (Default Security Scheme)
    • Labels:
    • Environment:
    • Sprint:
      Horizon - October 25th

      Description

      Customer reported the following exception stack trace in eventd.log after upgrading from Meridian 2016 to Meridian 2017.1.1:

      2017-10-24 12:45:20,915 WARN  [Main] o.s.c.s.ClassPathXmlApplicationContext: Exception encountered during context initialization - cancelling refresh attempt
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'groupManager-init' defined in class path resource [META-INF/opennms/applicationContext-commonConfigs.xml]: Invocation of init method failed; nested exception is java.lang.NumberFormatException: For input string: "900
         "
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[org.apache.servicemix.bundles.spring-context-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) [org.apache.servicemix.bundles.spring-context-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) [org.apache.servicemix.bundles.spring-context-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:105) [org.apache.servicemix.bundles.spring-context-4.1.6.RELEASE_1.jar:?]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_92]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_92]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_92]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:1.8.0_92]
      	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:962) [org.apache.servicemix.bundles.spring-context-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:396) [org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.opennms.core.spring.BeanUtils.getBeanFactory(BeanUtils.java:80) [org.opennms.core.spring-2017.1.1.jar:?]
      	at org.opennms.core.spring.BeanUtils.getFactory(BeanUtils.java:132) [org.opennms.core.spring-2017.1.1.jar:?]
      	at org.opennms.netmgt.daemon.AbstractSpringContextJmxServiceDaemon$1.run(AbstractSpringContextJmxServiceDaemon.java:103) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at org.opennms.core.logging.Logging.withPrefix(Logging.java:71) [org.opennms.core.logging-2017.1.1.jar:?]
      	at org.opennms.netmgt.daemon.AbstractSpringContextJmxServiceDaemon.init(AbstractSpringContextJmxServiceDaemon.java:96) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92]
      	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) [?:1.8.0_92]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92]
      	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) [?:1.8.0_92]
      	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) [?:1.8.0_92]
      	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) [?:1.8.0_92]
      	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) [?:1.8.0_92]
      	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) [?:1.8.0_92]
      	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) [?:1.8.0_92]
      	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [?:1.8.0_92]
      	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [?:1.8.0_92]
      	at org.opennms.netmgt.vmmgr.Invoker.invoke(Invoker.java:277) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at org.opennms.netmgt.vmmgr.Invoker.invokeMethods(Invoker.java:206) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at org.opennms.netmgt.vmmgr.Starter.start(Starter.java:154) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at org.opennms.netmgt.vmmgr.Starter.startDaemon(Starter.java:94) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at org.opennms.netmgt.vmmgr.Controller.start(Controller.java:173) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at org.opennms.netmgt.vmmgr.Controller.main(Controller.java:150) [org.opennms.core.daemon-2017.1.1.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92]
      	at org.opennms.bootstrap.Bootstrap$4.run(Bootstrap.java:525) [opennms_bootstrap.jar:?]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92]
      Caused by: java.lang.NumberFormatException: For input string: "900
         "
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_92]
      	at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_92]
      	at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_92]
      	at org.opennms.netmgt.config.users.DutySchedule.<init>(DutySchedule.java:178) ~[opennms-config-model-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupManager.buildDutySchedules(GroupManager.java:300) ~[opennms-config-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupManager.initializeGroupsAndRoles(GroupManager.java:149) ~[opennms-config-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupManager.parseXml(GroupManager.java:138) ~[opennms-config-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupFactory.reloadFromFile(GroupFactory.java:139) ~[opennms-config-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupFactory.reload(GroupFactory.java:126) ~[opennms-config-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupFactory.<init>(GroupFactory.java:79) ~[opennms-config-2017.1.1.jar:?]
      	at org.opennms.netmgt.config.GroupFactory.init(GroupFactory.java:91) ~[opennms-config-2017.1.1.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92]
      	at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:269) ~[org.apache.servicemix.bundles.spring-core-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.config.MethodInvokingBean.invokeWithTargetException(MethodInvokingBean.java:119) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:106) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570) ~[org.apache.servicemix.bundles.spring-beans-4.1.6.RELEASE_1.jar:?]
      	... 98 more
      

      The culprit turned out to be a duty-schedule in groups.xml:

         <duty-schedule>
          MoTuWeThFr0-900
         </duty-schedule>
      

      Fixing it up as follows fixed the problem:

         <duty-schedule>MoTuWeThFr0-900</duty-schedule>
      

      So it appears we need to trim the string before trying to parse its components. Maybe Castor did this for us?

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              jeffg Jeff Gehlbach
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: