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 in org.apache.felix.resolver.ProblemReduction.removeUsesViolations() #723

Open
Bananeweizen opened this issue Dec 16, 2024 · 1 comment

Comments

@Bananeweizen
Copy link
Contributor

I get this when trying to run plugin unit tests on a custom product with 2024-12 as active target platform:

java.lang.NullPointerException: Cannot invoke "org.osgi.resource.Capability.getResource()" because "currentCandidate" is null
	at org.apache.felix.resolver.ProblemReduction.removeUsesViolations(ProblemReduction.java:54)
	at org.apache.felix.resolver.Candidates.permutate(Candidates.java:1159)
	at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1580)
	at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1566)
	at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1566)
	at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1566)
	at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1566)
	at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1566)
	at org.apache.felix.resolver.ResolverImpl.checkConsistency(ResolverImpl.java:662)
	at org.apache.felix.resolver.ResolverImpl.findValidCandidates(ResolverImpl.java:615)
	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:478)
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:461)
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:415)
	at org.eclipse.osgi.container.ModuleResolver$ResolveProcess.resolveRevisions(ModuleResolver.java:1185)
	at org.eclipse.osgi.container.ModuleResolver$ResolveProcess.resolveRevisionsInBatch(ModuleResolver.java:1136)
	at org.eclipse.osgi.container.ModuleResolver$ResolveProcess.resolve(ModuleResolver.java:1052)
	at org.eclipse.osgi.container.ModuleResolver.resolveDelta(ModuleResolver.java:187)
	at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:743)
	at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:688)
	at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:675)
	at org.eclipse.osgi.container.Module.start(Module.java:476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2102)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:143)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2093)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2033)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1996)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1912)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341)

related to b1adfa2

The result of calling candidates.getFirstCandidate(requirement) is null-checked at other callers, so this really seems to be missing here.

@vogella
Copy link
Contributor

vogella commented Dec 16, 2024

cc @laeubi

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