Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when stopping automation core #241

Closed
BenediktNiehues opened this issue Nov 17, 2015 · 0 comments
Closed

NPE when stopping automation core #241

BenediktNiehues opened this issue Nov 17, 2015 · 0 comments

Comments

@BenediktNiehues
Copy link
Collaborator

A NullPointerException occurs when automation bundle is stopped after test executions in eclipse.
In the stop method of the automation.core.Activator, serviceTracker.close is called, which results in a removedService call of the ServiceTrackerCustomizer. This uses the ruleRegistry, but it was already set to null in the stop method.

There has to be added a null-check for the ruleRegistry in ServiceTrackerCustomizer and the serviceTracker.close() should be called before the ruleRegistry is set to null...

StackTrace:
org.osgi.framework.BundleException: Exception in org.eclipse.smarthome.automation.core.internal.Activator.stop() of bundle org.eclipse.smarthome.automation.core.
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:847)
at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:950)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:324)
at org.eclipse.osgi.container.Module.doStop(Module.java:626)
at org.eclipse.osgi.container.Module.stop(Module.java:488)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1623)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1542)
at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:248)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:145)
at org.eclipse.osgi.container.Module.doStop(Module.java:626)
at org.eclipse.osgi.container.Module.stop(Module.java:488)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:186)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:160)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.eclipse.smarthome.automation.core.internal.Activator$1.removedService(Activator.java:139)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:377)
at org.eclipse.smarthome.automation.core.internal.Activator.stop(Activator.java:187)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:827)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:820)
... 13 more
Root exception:
java.lang.NullPointerException
at org.eclipse.smarthome.automation.core.internal.Activator$1.removedService(Activator.java:139)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:967)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.untrack(AbstractTracked.java:341)
at org.osgi.util.tracker.ServiceTracker.close(ServiceTracker.java:377)
at org.eclipse.smarthome.automation.core.internal.Activator.stop(Activator.java:187)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:827)
at org.eclipse.osgi.internal.framework.BundleContextImpl$4.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.stop(BundleContextImpl.java:820)
at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:950)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:324)
at org.eclipse.osgi.container.Module.doStop(Module.java:626)
at org.eclipse.osgi.container.Module.stop(Module.java:488)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1623)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1542)
at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:248)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:145)
at org.eclipse.osgi.container.Module.doStop(Module.java:626)
at org.eclipse.osgi.container.Module.stop(Module.java:488)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:186)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:160)
at java.lang.Thread.run(Thread.java:745)

danchom pushed a commit that referenced this issue Nov 17, 2015
Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
BenediktNiehues added a commit that referenced this issue Nov 17, 2015
NPE when stopping automation core #241
danchom pushed a commit that referenced this issue Nov 23, 2015
Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit that referenced this issue Nov 23, 2015
Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants