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 ArrayIndexOutOfBoundsException with * command on Conditional-Package option #2220

Closed
reyman opened this issue Dec 3, 2017 · 3 comments
Closed

Comments

@reyman
Copy link

reyman commented Dec 3, 2017

Hi,
I recently reported the issue in goomph which use the latest version of bndtools to declare Manifest :

When i add * option to 'Conditional-Package', i have an error java.lang.ArrayIndexOutOfBoundsException

I already report this error in goomph issue tracker :
diffplug/goomph#40 (comment)

The code which report this error is here : https://github.com/ANRGenstar/gamaplugin

@bjhargrave
Copy link
Member

When I cloned the gamaplugin project and ran ./gradlew, I saw the following downloads:

Download https://plugins.gradle.org/m2/biz/aQute/bnd/bndlib/2.2.0/bndlib-2.2.0.pom
Download https://plugins.gradle.org/m2/biz/aQute/bnd/parent/2.2.0/parent-2.2.0.pom
Download https://plugins.gradle.org/m2/biz/aQute/bnd/biz.aQute.bndlib/3.2.0/biz.aQute.bndlib-3.2.0.pom
Download https://plugins.gradle.org/m2/biz/aQute/bnd/bndlib/2.2.0/bndlib-2.2.0.jar
Download https://plugins.gradle.org/m2/biz/aQute/bnd/biz.aQute.bndlib/3.2.0/biz.aQute.bndlib-3.2.0.jar

So it appears that both bndlib 2.2.0 and bndlib 3.2.0 are BOTH being used which is a source of concern.

And I was able to build the project without seeing any ArrayIndexOutOfBoundsException.

So you need to provide more specific directions on how to reproduce the issue with Bndlib 3.5 which is the current release. The code in this area has change quite significantly since 3.2 and the stacktrace information in your bug is incomplete (it is missing the top lines) and does not fit the current code.

Even more disturbing is that the stacktrace information does fit the Bndlib 2.2 code:

return parseClassFileWithCollector(null);
}
public Set<TypeRef> parseClassFile(InputStream in) throws Exception {
return parseClassFile(in, null);
}
public Set<TypeRef> parseClassFileWithCollector(ClassDataCollector cd) throws Exception {
InputStream in = resource.openInputStream();
try {
return parseClassFile(in, cd);
which means your problem may be caused by having 2 versions of Bndlib on the gradle plugin classpath since it appears you are in the Bndlib 2.2 code when you get the exception. This could also explain by trying to use Bndlib 3.5 did not address the problem.

I suggest you understand why there are 2 versions of Bndlib present and fix that first. Perhaps some other dependent is pulling in Bndlib 2.2.

@reyman
Copy link
Author

reyman commented Dec 4, 2017

Ok thanks for information, i try to trace the error and i post here if i have news.

Edit :
Hum, i use bnd-tools and goomph in my root buildscrit, and they use different version of bndlib :

  • goomph 3.9.0 will use bndlib 3.5.0
  • bnd-tools use bndlib 3.3.0

I try to search which package download bndlib 2.2.0 ....

Edit, found using buildEnvironement command, bnd-platform:1.5.0 use bndlib 2.2.0, so this is probably a problem of bnd-tools ..

+--- org.standardout:bnd-platform:1.5.0
|    +--- biz.aQute.bnd:bndlib:2.2.0
|    |    \--- org.osgi:org.osgi.core:4.2.0
|    +--- commons-io:commons-io:2.4
|    \--- de.undercouch:gradle-download-task:3.1.1
|         \--- org.apache.httpcomponents:httpclient:4.4.1
|              +--- org.apache.httpcomponents:httpcore:4.4.1
|              +--- commons-logging:commons-logging:1.2
|              \--- commons-codec:commons-codec:1.9
\--- com.diffplug.gradle:goomph:3.9.0-SNAPSHOT
     +--- com.diffplug.durian:durian-core:1.2.0
     +--- com.diffplug.durian:durian-collect:1.2.0
     |    \--- com.diffplug.durian:durian-core:1.2.0
     +--- com.diffplug.durian:durian-io:1.2.0
     |    +--- com.diffplug.durian:durian-core:1.2.0
     |    \--- com.diffplug.durian:durian-collect:1.2.0 (*)
     +--- com.diffplug.durian:durian-swt:2.0.0
     |    +--- com.diffplug.durian:durian-core:1.2.0
     |    +--- com.diffplug.durian:durian-collect:1.2.0 (*)
     |    +--- com.diffplug.durian:durian-concurrent:1.2.0
     |    |    +--- com.diffplug.durian:durian-core:1.2.0
     |    |    \--- com.diffplug.durian:durian-collect:1.2.0 (*)
     |    +--- com.diffplug.durian:durian-rx:2.0.0
     |    |    +--- com.diffplug.durian:durian-core:1.2.0
     |    |    +--- com.diffplug.durian:durian-concurrent:1.2.0 (*)
     |    |    \--- io.reactivex:rxjava:1.1.0
     |    \--- io.reactivex:rxjava:1.1.0
     +--- commons-io:commons-io:2.4
     +--- com.diffplug.spotless:spotless-lib:1.5.1
     +--- biz.aQute.bnd:biz.aQute.bndlib:3.2.0
     \--- org.eclipse.tycho:org.eclipse.osgi:3.10.101.v20150820-1432

I update the version of Bnd-platform to latest SNAPSHOT version : https://github.com/stempler/bnd-platform#using-the-current-snapshot

@bjhargrave
Copy link
Member

The joys of transitive dependencies...

I will close this issue since the problem is not in Bnd itself.

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