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

SI-8927 Update OSGi stuff to get rid of bndlib warning #4066

Merged
merged 1 commit into from Nov 4, 2014

Conversation

soc
Copy link
Member

@soc soc commented Oct 20, 2014

The way the desired OSGi frameworks are chosen has changed between
Pax Exam versions:

On earlier versions, specifying it in code was fine, but PAX Exam 4.x
runs the tests on the first OSGi framework it finds on classpath.

An exclusion for the transitive dependency org.osgi.core was added,
because it seems that artifact has broken dependecies (which would
have brought us back to square one).
Good thing is that it isn't needed here, because the OSGi framework JARs
contain all necessary classes.

@soc soc changed the title SI-8927 Updating OSGi stuff to get rid of bndlib warning SI-8927 Update OSGi stuff to get rid of bndlib warning Oct 20, 2014
@soc
Copy link
Member Author

soc commented Oct 20, 2014

Thanks to and pre-review by @rkrzewski, work was done by him.

@scala-jenkins scala-jenkins added this to the 2.11.5 milestone Oct 20, 2014
@rkrzewski
Copy link
Contributor

The reason for test failure was that PAX Exam 4.x requires JDK 7.
I've checked locally that downgrading PAX Exam to version 3.5.0 allows the tests to pass on JDK 6.

@soc
Copy link
Member Author

soc commented Oct 21, 2014

@rkrzewski Yes, I changed that, but now BasicTest is failing again ...

java.lang.NoSuchMethodError: org.osgi.framework.BundleEvent.<init>(ILorg/osgi/framework/Bundle;Lorg/osgi/framework/Bundle;)V
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4249)
    at org.apache.felix.framework.Felix.installBundle(Felix.java:2881)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:138)
    at org.ops4j.pax.exam.nat.internal.NativeTestContainer.installAndStartBundles(NativeTestContainer.java:307)
    at org.ops4j.pax.exam.nat.internal.NativeTestContainer.start(NativeTestContainer.java:175)
    at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
    at org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:278)
    at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:112)
    at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)

@rkrzewski
Copy link
Contributor

Weird. The stacktrace above indicates a classpath issue.
Here's what I've been testing: https://github.com/rkrzewski/scala/tree/SI-8927
I've recompiled everyting from scratch under JDK 1.6.0_45 and verified that ant test.osgi passes.
Can you send me build/osgi/TEST-tools.test.osgi.BasicTest.xml by email? I'd like to take a look at classpath details.

@soc
Copy link
Member Author

soc commented Oct 22, 2014

Here it is: https://gist.github.com/soc/39598ec3c6b4bb0d5295

(I also removed the exclude <exclusion groupId="org.osgi" artifactId="org.osgi.core"/> but I think this shouldn't be the cause of the issue, right?)

@rkrzewski
Copy link
Contributor

You shouldn't have. That precisely is the issue ;)

@soc
Copy link
Member Author

soc commented Oct 22, 2014

Oh dammit! Sorry, for that ... I'll fix it and push -f it again.

The way the desired OSGi frameworks are chosen has changed between
Pax Exam versions:

On earlier versions, specifying it in code was fine, but PAX Exam 4.x
runs the tests on the first OSGi framework it finds on classpath.

An exclusion for the transitive dependency org.osgi.core was added,
because it seems that artifact has broken dependecies (which would
have brought us back to square one).
Good thing is that it isn't needed here, because the OSGi framework JARs
contain all necessary classes.
@soc
Copy link
Member Author

soc commented Oct 23, 2014

Mhhh, based on commit history review by @adriaanm might be the best, I guess.

@adriaanm
Copy link
Contributor

LGTM! Sweet! Thanks for figuring out the magic incantation. One step closer to noiseless builds!!

lrytz added a commit that referenced this pull request Nov 4, 2014
SI-8927 Update OSGi stuff to get rid of bndlib warning
@lrytz lrytz merged commit ae70f02 into scala:2.11.x Nov 4, 2014
retronym added a commit to retronym/scala that referenced this pull request Jan 28, 2015
We use the PAX Exam framework to integration test that the
OSGi metadata we add to our JARs allows them to be loaded
into the Felix and Equinox containers. However, we had to
disable this test under Java 8 due to an incompatibility between
that framework and the modern Java version.

I have found a combination that works in Java 6, 7, and 8,
so the test is now run under all Java versions.

I have left a `skip` property to disable them, following the
established convention.

Tip of the hat to:

  - @soc / @rkrzewski for the work in scala#4066 that paved the way
    for this small change
  - Harald Wellman, for sharing [1] the Java 8 compatible combination
    of PAX and Felix .

Testing:

```
for V in 1.6 1.7 1.8; do java_use $V; ant -q test.osgi; done
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 31 seconds
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 22 seconds
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 16 seconds
```

[1] https://groups.google.com/d/msg/ops4j/TN0sZFf6wLs/vUP0GML6-TQJ
retronym added a commit to retronym/scala that referenced this pull request Jan 28, 2015
We use the PAX Exam framework to integration test that the
OSGi metadata we add to our JARs allows them to be loaded
into the Felix and Equinox containers. However, we had to
disable this test under Java 8 due to an incompatibility between
that framework and the modern Java version.

I have found a combination that works in Java 6, 7, and 8,
so the test is now run under all Java versions.

I have left a `skip` property to disable them, following the
established convention.

Tip of the hat to:

  - @soc / @rkrzewski for the work in scala#4066 that paved the way
    for this small change
  - Harald Wellman, for sharing [1] the Java 8 compatible combination
    of PAX and Felix .

Testing:

```
for V in 1.6 1.7 1.8; do java_use $V; ant -q test.osgi; done
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 31 seconds
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 22 seconds
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 16 seconds
```

[1] https://groups.google.com/d/msg/ops4j/TN0sZFf6wLs/vUP0GML6-TQJ
retronym added a commit to retronym/scala that referenced this pull request Jan 28, 2015
We use the PAX Exam framework to integration test that the
OSGi metadata we add to our JARs allows them to be loaded
into the Felix and Equinox containers. However, we had to
disable this test under Java 8 due to an incompatibility between
that framework and the modern Java version.

I have found a combination that works in Java 6, 7, and 8,
so the test is now run under all Java versions.

I have left a `skip` property to disable them, following the
established convention.

Tip of the hat to:

  - @soc / @rkrzewski for the work in scala#4066 that paved the way
    for this small change
  - Harald Wellman, for sharing [1] the Java 8 compatible combination
    of PAX and Felix .

Testing:

```
for V in 1.6 1.7 1.8; do java_use $V; ant -q test.osgi; done
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 31 seconds
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 22 seconds
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 16 seconds
```

[1] https://groups.google.com/d/msg/ops4j/TN0sZFf6wLs/vUP0GML6-TQJ
dumpstate pushed a commit to dumpstate/scala that referenced this pull request Feb 17, 2015
We use the PAX Exam framework to integration test that the
OSGi metadata we add to our JARs allows them to be loaded
into the Felix and Equinox containers. However, we had to
disable this test under Java 8 due to an incompatibility between
that framework and the modern Java version.

I have found a combination that works in Java 6, 7, and 8,
so the test is now run under all Java versions.

I have left a `skip` property to disable them, following the
established convention.

Tip of the hat to:

  - @soc / @rkrzewski for the work in scala#4066 that paved the way
    for this small change
  - Harald Wellman, for sharing [1] the Java 8 compatible combination
    of PAX and Felix .

Testing:

```
for V in 1.6 1.7 1.8; do java_use $V; ant -q test.osgi; done
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 31 seconds
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 22 seconds
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
     ...
     [echo] Running OSGi JUnit tests. Output in /Users/jason/code/scala3/build/osgi
     [echo] Test pass 1 of 2 using Apache Felix 4.4.0
     [echo] Test pass 2 of 2 using Eclipse Equinox 3.7.1

BUILD SUCCESSFUL
Total time: 16 seconds
```

[1] https://groups.google.com/d/msg/ops4j/TN0sZFf6wLs/vUP0GML6-TQJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants