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

bnd-export-maven-plugin:7.1.0 java.lang.NoSuchMethodError #6389

Open
fipro78 opened this issue Dec 4, 2024 · 4 comments
Open

bnd-export-maven-plugin:7.1.0 java.lang.NoSuchMethodError #6389

fipro78 opened this issue Dec 4, 2024 · 4 comments

Comments

@fipro78
Copy link

fipro78 commented Dec 4, 2024

I worked on updating my blog post to the latest Eclipse and Bndtools:

https://vogella.com/blog/building-a-headless-rcp-application-with-tycho/
https://github.com/fipro78/osgi-ds-getting-started-pde

After updating the bnd-export-maven-plugin to 7.0.0 I get the error Default handler for Launcher-Plugin not found in biz.aQute.launcher

To fix this I had to add the dependency to biz.aQute.launcher.

Searching around, I got the impression that this issue was fixed years ago, as I did not encounter it with the version I used before. Is this maybe a regression?
bndtools/bndtools#1294

Then I noticed that Bndtools 7.1.0 was released, so I updated my example to that version. But that fails with the following error:

Execution default of goal biz.aQute.bnd:bnd-export-maven-plugin:7.1.0:export failed: An API incompatibility was encountered while executing biz.aQute.bnd:bnd-export-maven-plugin:7.1.0:export: java.lang.NoSuchMethodError: 'aQute.bnd.osgi.Processor aQute.bnd.build.model.BndEditModel.getOwner()'
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>biz.aQute.bnd:bnd-export-maven-plugin:7.1.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/fad8pl/.m2/repository/biz/aQute/bnd/bnd-export-maven-plugin/7.1.0/bnd-export-maven-plugin-7.1.0.jar
[ERROR] urls[1] = file:/C:/Users/fad8pl/.m2/repository/biz/aQute/bnd/biz.aQute.bnd.maven/7.1.0/biz.aQute.bnd.maven-7.1.0.jar
[ERROR] urls[2] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.dto/1.0.0/org.osgi.dto-1.0.0.jar
[ERROR] urls[3] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.resource/1.0.0/org.osgi.resource-1.0.0.jar
[ERROR] urls[4] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.framework/1.8.0/org.osgi.framework-1.8.0.jar
[ERROR] urls[5] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.service.repository/1.1.0/org.osgi.service.repository-1.1.0.jar
[ERROR] urls[6] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.util.function/1.2.0/org.osgi.util.function-1.2.0.jar
[ERROR] urls[7] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/osgi.annotation/8.0.1/osgi.annotation-8.0.1.jar
[ERROR] urls[8] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.util.promise/1.2.0/org.osgi.util.promise-1.2.0.jar
[ERROR] urls[9] = file:/C:/Users/fad8pl/.m2/repository/biz/aQute/bnd/biz.aQute.bnd.util/7.1.0/biz.aQute.bnd.util-7.1.0.jar
[ERROR] urls[10] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.util.tracker/1.5.4/org.osgi.util.tracker-1.5.4.jar
[ERROR] urls[11] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.service.log/1.3.0/org.osgi.service.log-1.3.0.jar
[ERROR] urls[12] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.service.serviceloader/1.0.0/org.osgi.service.serviceloader-1.0.0.jar
[ERROR] urls[13] = file:/C:/Users/fad8pl/.m2/repository/biz/aQute/bnd/biz.aQute.resolve/7.1.0/biz.aQute.resolve-7.1.0.jar
[ERROR] urls[14] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.service.resolver/1.1.1/org.osgi.service.resolver-1.1.1.jar
[ERROR] urls[15] = file:/C:/Users/fad8pl/.m2/repository/biz/aQute/bnd/biz.aQute.repository/7.1.0/biz.aQute.repository-7.1.0.jar
[ERROR] urls[16] = file:/C:/Users/fad8pl/.m2/repository/org/osgi/org.osgi.service.coordinator/1.0.2/org.osgi.service.coordinator-1.0.2.jar
[ERROR] urls[17] = file:/C:/Users/fad8pl/.m2/repository/biz/aQute/bnd/biz.aQute.bnd.embedded-repo/7.1.0/biz.aQute.bnd.embedded-repo-7.1.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>org.fipro:org.fipro.parent:1.0.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
@chrisrueger
Copy link
Contributor

chrisrueger commented Dec 4, 2024

I noticed the Number of foreign imports: 1 and I remembered that @laeubi had something similar here in one of the builds in PR #6362:

https://github.com/bndtools/bnd/actions/runs/11756946869/job/32755421072#step:7:4010

There was something with the maven dependencies so that a wrong outdated version was pulled in.
See also here

BndEditModel.getOwner() is definitly a new method added in 7.1.0 and it seems to not find this method (NoSuchMethodError) which sounds like an older version is used.

I think @laeubi or @bjhargrave can explain better.

@bjhargrave
Copy link
Member

Can we get a full stacktrace?

@bjhargrave
Copy link
Member

I am also surprised I don't see biz.aQute.bndlib in the list of URLs since it is a dependency of biz.aQute.bnd.maven and bnd-export-maven-plugin. Is there some exclusion on your plugin configuration?

@laeubi
Copy link
Contributor

laeubi commented Dec 5, 2024

@chrisrueger I have extracted it here:

@fipro78 just to make sure have you run the build with -U flag? Sadly maven (central) is sometimes slow in updating the meta-data and this can lead to strange errors of larger sets of interrelated jars to not fully downloaded into the local repo sometimes.

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

4 participants