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

on 'sbt run', Thread.currentThread.getContextClassLoader cannot load scala.Int #3736

Closed
raboof opened this issue Nov 13, 2017 · 6 comments
Closed

Comments

@raboof
Copy link
Contributor

raboof commented Nov 13, 2017

steps

Check out https://github.com/raboof/sbt-run-classloading and sbt run

problem

An error is thrown trying to load the scala.Int class

notes

This might be related to #3515, however there it is mentioned that it only fails for URLClassLoaders, while I get a ClasspathFilter:

ClasspathFilter(
  parent = URLClassLoader with NativeCopyLoader with RawResources
(
  urls = Vector(/tmp/sbt_db097681/job-6/target/d9ce6563/bug-facto
ryconfig_2.12-0.1-SNAPSHOT.jar, /tmp/sbt_db097681/target/7663f74e
/scala-library.jar),
  parent = java.net.URLClassLoader@5056dfcb,
  resourceMap = Set(app.class.path, boot.class.path),
  nativeTemp = /tmp/sbt_baa31d30
)
  root = sun.misc.Launcher$AppClassLoader@677327b6
  cp = Set(/tmp/sbt_db097681/job-6/target/d9ce6563/bug-factorycon
fig_2.12-0.1-SNAPSHOT.jar, /tmp/sbt_db097681/target/7663f74e/scal
a-library.jar)
)

@gmarti
Copy link

gmarti commented Dec 4, 2017

i have same problem with sbt 0.13.6 scala 2.11.8 and akka-remote 2.5.4
If i start my project without akka-remote i don't have the scala.Int exception.

I try to make a short example

@franbh
Copy link

franbh commented Dec 7, 2017

I had this problem while starting a new project until I realized that I had forgotten to fork the JVM for the run task:
fork in run := true

Although this seems to be a SBT regression, the workaround is pretty simple.

BTW I'm using SBT 1.0.4, Scala 2.12.4, Akka 2.5.7.

@ktoso
Copy link
Member

ktoso commented Dec 13, 2017

Just making sure you've seen this @eed3si9n @dwijnand;
It seems to stop us from moving quickstart examples to sbt 1.0 etc.
So the workaround with forking exists, but is a bit too weird for users (esp in our quickstarts, when things would stop working if not forked)

@ravwojdyla
Copy link

Just for the reference, PTAL: sbt/zinc#473

ravwojdyla pushed a commit to ravwojdyla/zinc that referenced this issue Dec 20, 2017
eed3si9n added a commit to eed3si9n/zinc that referenced this issue Dec 22, 2017
ravwojdyla pushed a commit to ravwojdyla/zinc that referenced this issue Dec 22, 2017
eed3si9n added a commit to sbt/zinc that referenced this issue Dec 22, 2017
Fix sbt/sbt#3736. Recurse into classloader of the class not the root
@eed3si9n
Copy link
Member

eed3si9n commented Dec 22, 2017

Zinc fix is now merged. Please try sbt 1.1.0-RC3.

notthatbreezy added a commit to raster-foundry/raster-foundry that referenced this issue Jan 18, 2018
notthatbreezy added a commit to raster-foundry/raster-foundry that referenced this issue Jan 18, 2018
@dwijnand dwijnand modified the milestones: 1.1.1, 1.1.0 Jan 31, 2018
@raboof
Copy link
Contributor Author

raboof commented May 30, 2018

(this issue may have returned in 1.1.5, at least something that looks a lot like it, but I'll first dig a bit further in akka/akka#24098 before really blaming sbt 😄 )

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

No branches or pull requests

7 participants