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

moved the call to remove group membership inside of the null check #1897

Conversation

shsteimer
Copy link
Contributor

This is to fix an NPE I found in the logs with a ensureGroup config with operation of remove. The second (or any subequent time) the remove is activated, the NPE is thrown.

com.adobe.acs.commons.users.impl.EnsureAuthorizableException: Failed to ensure [ REMOVE ] of Group [ my-group ]
	at com.adobe.acs.commons.users.impl.EnsureGroup.ensure(EnsureGroup.java:152)
	at com.adobe.acs.commons.users.impl.EnsureGroup.activate(EnsureGroup.java:348)
	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:497)
	at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
	at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
	at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:298)
	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109)
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:749)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:675)
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:430)
	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:657)
	at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:341)
	at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:390)
	at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)
	at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:265)
	at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
	at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
	at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)
	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
	at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
	at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:916)
	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:835)
	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:517)
	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4542)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2173)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1372)
	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: null
	at com.adobe.acs.commons.users.impl.EnsureGroup.ensureRemoveMembership(EnsureGroup.java:326)
	at com.adobe.acs.commons.users.impl.EnsureGroup.ensureRemoval(EnsureGroup.java:197)
	at com.adobe.acs.commons.users.impl.EnsureGroup.ensure(EnsureGroup.java:136)
	... 37 common frames omitted

@update-changelog
Copy link

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update the CHANGELOG.md file with this pull request.

@coveralls
Copy link

coveralls commented May 15, 2019

Pull Request Test Coverage Report for Build 4377

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 52.495%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bundle/src/main/java/com/adobe/acs/commons/users/impl/EnsureGroup.java 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
bundle/src/main/java/com/adobe/acs/commons/users/impl/EnsureGroup.java 2 0.0%
Totals Coverage Status
Change from base Build 4373: 0.0%
Covered Lines: 13234
Relevant Lines: 25210

💛 - Coveralls

Copy link
Contributor

@davidjgonzalez davidjgonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the change log as well? Otherwise looks good

@badvision badvision dismissed davidjgonzalez’s stale review May 16, 2019 16:32

Changelog was updated

badvision
badvision previously approved these changes May 16, 2019
@badvision badvision merged commit a3da5df into Adobe-Consulting-Services:master May 16, 2019
@badvision badvision added this to the 4.1.2 milestone May 16, 2019
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

Successfully merging this pull request may close these issues.

4 participants