[
https://issues.apache.org/jira/browse/ARIES-1429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Ross reopened ARIES-1429:
------------------------------
I'm reopening this because the current solution needs some improvement.
Currently, the region updater is the one that decides whether or not a missing
connection between parent and child is acceptable. However, the region updater
is used when adding new requirements in support of the AriesSubsystem interface
in addition to the woven class listener. While allowing the connection to not
exist is appropriate for the latter, the same is not true for the former. The
contract for AriesSubsystem.addRequirements requires that an exception be
thrown if the requirements could not be added for any reason.
> NullPointerException at
> org.apache.aries.subsystem.core.internal.WovenClassListener.modified at
> org.apache.aries.subsystem.core.internal.RegionUpdater.addRequirements
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: ARIES-1429
> URL: https://issues.apache.org/jira/browse/ARIES-1429
> Project: Aries
> Issue Type: Bug
> Components: Subsystem
> Affects Versions: subsystem-2.0.4
> Reporter: John Ross
> Assignee: John Ross
> Fix For: subsystem-2.0.6
>
>
> A NullPointerException [1] may occur while updating a region as part of
> adding dynamic imports to the sharing policy for a bundle containing a woven
> class. This will only occur when something outside of the subsystems
> implementation for whatever reason has deleted the region digraph edge that
> connects the parent subsystem to the subsystem containing the bundle whose
> class is being woven as a constituent.
> Still, it would be useful if the implementation would allow this by replacing
> the NPE with a noop. In other words, if the implementation does not find an
> existing edge between parent and child, it would simply assume that something
> else is handling the dynamic imports.
> [1]
> org.osgi.service.subsystem.SubsystemException: java.lang.NullPointerException
> at
> org.apache.aries.subsystem.core.internal.WovenClassListener.modified(WovenClassListener.java:125)
> at
> org.eclipse.osgi.internal.weaving.WovenClassImpl$1.call(WovenClassImpl.java:203)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHookPrivileged(ServiceRegistry.java:1280)
> at
> org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHooksPrivileged(ServiceRegistry.java:1263)
> at
> org.eclipse.osgi.internal.weaving.WovenClassImpl.notifyWovenClassListeners(WovenClassImpl.java:220)
> at
> org.eclipse.osgi.internal.weaving.WovenClassImpl.callHooks(WovenClassImpl.java:271)
> at
> org.eclipse.osgi.internal.weaving.WeavingHookConfigurator.processClass(WeavingHookConfigurator.java:56)
> at
> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:616)
> at
> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
> at
> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
> at
> org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
> at
> org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:330)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:407)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:357)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:349)
> at
> org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:757)
> at
> org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:711)
> at
> org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:951)
> at
> org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:328)
> at org.eclipse.osgi.container.Module.doStart(Module.java:566)
> at org.eclipse.osgi.container.Module.start(Module.java:434)
> at
> org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
> at
> org.apache.aries.subsystem.core.internal.StartAction.startBundleResource(StartAction.java:337)
> at
> org.apache.aries.subsystem.core.internal.StartAction.startResource(StartAction.java:365)
> at
> org.apache.aries.subsystem.core.internal.StartAction.run(StartAction.java:128)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.aries.subsystem.core.internal.BasicSubsystem.start(BasicSubsystem.java:295)
> ...
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NullPointerException
> at
> org.apache.aries.subsystem.core.internal.RegionUpdater.addRequirements(RegionUpdater.java:106)
> at
> org.apache.aries.subsystem.core.internal.RegionUpdater.addRequirements(RegionUpdater.java:60)
> at
> org.apache.aries.subsystem.core.internal.WovenClassListener.modified(WovenClassListener.java:122)
> ... 39 more
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)