Skip to content

toJava call on future converter causes java.lang.NoClassDefFoundError: scala/concurrent/java8/FuturesConvertersImpl$CF, #26

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

Closed
jasongoodwin opened this issue Feb 15, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@jasongoodwin
Copy link

Hey,

on v0.2.0 published to maven,
I've produced a barebones sbt project with only the scala-java8-compat library.
You can recreate by running sbt test on this project:
https://github.com/jasongoodwin/future-converters-problem

There is a unit test that fails:

@Test
public void itShouldNotFail() {
    Future future = promise().future();
    final CompletionStage cs = toJava(future);
}

It causes this exception

[error] Test pong.JavaAskExamplesTest.itShouldNotFail failed: java.lang.NoClassDefFoundError: scala/concurrent/java8/FuturesConvertersImpl$CF, took 0.062 sec
[error]     at scala.compat.java8.FutureConverters$.toJava(FutureConverters.scala:54)
[error]     at scala.compat.java8.FutureConverters.toJava(FutureConverters.scala)
[error]     at pong.JavaAskExamplesTest.itShouldNotFail(JavaAskExamplesTest.java:14)
[error]     ...
[error] Caused by: java.lang.ClassNotFoundException: scala.concurrent.java8.FuturesConvertersImpl$CF
[error]     at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
[error]     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[error]     at java.security.AccessController.doPrivileged(Native Method)
[error]     at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
[error]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[error]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[error]     ... 58 more
[error] Failed: Total 1, Failed 1, Errors 0, Passed 0
[error] Failed tests:
[error]     pong.JavaAskExamplesTest
[error] (test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 32 s, completed 15-Feb-2015 10:43:38 AM
@retronym
Copy link
Member

Thanks for the report. Looks like the OSGi packaging in our build stripped those classes out of the final JAR. 😢

I'll cut a new release as soon as the fix is reviewed and merged.

@retronym retronym self-assigned this Feb 16, 2015
@retronym retronym added the bug label Feb 16, 2015
@retronym retronym added this to the 0.3.0 milestone Feb 16, 2015
@jasongoodwin
Copy link
Author

That's for publishing this so fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants