Service Registry throws NPE exception on startup

Steps to reproduce

Steps to reproduce:
1. Apply fix https://bitbucket.org/opencast-community/matterhorn/commits/d2c807479927748a79ce4b00f0f66b96fa8d5b03
2. Startup matterhorn with a db that has loads of jobs

Actual Results:
ServiceRegistry throws a NPE

Expected Results:
Startup should be as expected (no errors)

Workaround (if any):
remove fix

Activity

Show:
Edmore Moyo
March 3, 2015, 11:26 AM

Error message (with some logging) :

2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:124) - Mail transport protocol is 'smtp'
2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:195) - Mail service configured with localhost
2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:199) - mail.smtp.port: 25
2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:199) - mail.from: matterhorn@localhost
2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:199) - mail.transport.protocol: smtp
2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:199) - mail.smtp.host: localhost
2015-03-03 12:00:15 INFO [CM Configuration Updater (ManagedService Update: pid=org.opencastproject.kernel.mail.SmtpService)] (SmtpService:199) - mail.smtp.auth: false
2015-03-03 12:00:15 INFO [fileinstall-/opt/matterhorn/etc/security] (SpringSecurityConfigurationArtifactInstaller:115) - registered OsgiBundleXmlApplicationContext(bundle=matterhorn-kernel, config=file:/opt/matterhorn/etc/security/mh_default_org.xml): startup date [Thu Jan 01 02:00:00 SAST 1970]; root of context hierarchy for mh_default_org
2015-03-03 12:00:15 INFO [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:239) - Activate service registery
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 1773.9815
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 11150
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 1226335.8585
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FINISHED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 184.0
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 2
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 4060.5
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FAILED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 5299.7851
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 1089
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 15904.6713
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FINISHED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 21701.2376
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 425
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 6034.2424
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FINISHED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 0.0
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 1
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 0.0
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : QUEUED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 0.0
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 7574
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 8063201.1851
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : PAUSED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 0.0
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 15
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 2.527700564667E8
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : RUNNING
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 1467155.3328
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 17193
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 3.70175453879E7
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FINISHED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 1.8016461973E7
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 222
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 1.236665659414E8
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FAILED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 5582833.5611
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 998
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 1.145322649689E8
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : DELETED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 44815.8844
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 467
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 7.9165
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FINISHED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 2828158.5
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 2
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 14.5
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FAILED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 0.0
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 6
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 9.1667
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : CANCELED
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1733) - meanRuntime : 17951.5
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1734) - count : 2
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1735) - meanQueueTime : 15302.5
2015-03-03 12:00:16 WARN [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:1736) - status : FINISHED
2015-03-03 12:00:16 ERROR [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:266) - Error registarting JMX statistic beans {}
org.opencastproject.serviceregistry.api.ServiceRegistryException: java.lang.NullPointerException
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.getServiceStatistics(ServiceRegistryJpaImpl.java:1775)
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.activate(ServiceRegistryJpaImpl.java:258)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)
at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)
at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333)
at org.apache.felix.scr.impl.manager.DependencyManager.serviceAdded(DependencyManager.java:283)
at org.apache.felix.scr.impl.manager.DependencyManager.serviceChanged(DependencyManager.java:170)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4260)
at org.apache.felix.framework.Felix.registerService(Felix.java:3275)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:449)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerComponentService(AbstractComponentManager.java:460)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:1009)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:157)
at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.enableComponents(ConfiguredComponentHolder.java:256)
at org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:253)
at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147)
at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111)
at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:285)
at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:203)
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1923)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: java.lang.NullPointerException
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.getServiceStatistics(ServiceRegistryJpaImpl.java:1752)
... 43 more
2015-03-03 12:00:16 INFO [fileinstall-/opt/matterhorn/lib/matterhorn] (ServiceRegistryJpaImpl:957) - Registering http://mediadev.cet.uct.ac.za with a maximum load of 2
2015-03-03 12:00:16 ERROR [fileinstall-/opt/matterhorn/lib/matterhorn] (?:?) - [org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl] The activate method has thrown an exception
java.lang.IllegalStateException: Unable to register host http://mediadev.cet.uct.ac.za in the service registry
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.activate(ServiceRegistryJpaImpl.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)
at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)
at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)
at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:997)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333)
at org.apache.felix.scr.impl.manager.DependencyManager.serviceAdded(DependencyManager.java:283)
at org.apache.felix.scr.impl.manager.DependencyManager.serviceChanged(DependencyManager.java:170)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4260)
at org.apache.felix.framework.Felix.registerService(Felix.java:3275)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:449)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerComponentService(AbstractComponentManager.java:460)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:1009)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:333)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:157)
at org.apache.felix.scr.impl.config.ConfiguredComponentHolder.enableComponents(ConfiguredComponentHolder.java:256)
at org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:253)
at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147)
at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111)
at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:285)
at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:203)
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:868)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:789)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:514)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1923)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:458)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
Caused by: org.opencastproject.serviceregistry.api.ServiceRegistryException: java.lang.NullPointerException
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.registerHost(ServiceRegistryJpaImpl.java:964)
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.activate(ServiceRegistryJpaImpl.java:291)
... 42 more
Caused by: java.lang.NullPointerException
at org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.registerHost(ServiceRegistryJpaImpl.java:959)
... 43 more
2015-03-03 12:00:16 ERROR [fileinstall-/opt/matterhorn/lib/matterhorn] (?:?) - [org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl] Component instance could not be created, activation failed

Fixed and reviewed

Assignee

Lukas Rohner

Reporter

Edmore Moyo

Severity

Non Functioning

Tags (folksonomy)

Components

Fix versions

Affects versions

Priority

Major