I am new to Mac and Scala/Play-framework and trying to setup and run a webapp locally, but getting an error which I assume is an issue with the M1 silicone processor. Installing the webapp with sbt dist works fine, but when running it using command run -Dconfig.file=./app.conf -Djdk.tls.trustNameService=true -Dhttps.port=8080 -Dhttp.port=8081 it gives a jna error. My system operative is Mac Monterey.
Full error:
[error] java.lang.UnsatisfiedLinkError: Can't load library:/Users/roozbeh.merandi/Library/Caches/JNA/temp/jna6522888454902179447.tmp
[error] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2633)
[error] at java.base/java.lang.Runtime.load0(Runtime.java:768)
[error] at java.base/java.lang.System.load(System.java:1837)
[error] at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
[error] at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
[error] at com.sun.jna.Native.<clinit>(Native.java:195)
[error] at io.methvin.watchservice.jna.CarbonAPI.<clinit>(CarbonAPI.java:20)
[error] at io.methvin.watchservice.jna.CFStringRef.toCFString(CFStringRef.java:23)
[error] at io.methvin.watchservice.MacOSXListeningWatchService.register(MacOSXListeningWatchService.java:127)
[error] at io.methvin.watchservice.WatchablePath.register(WatchablePath.java:50)
[error] at io.methvin.watcher.DirectoryWatcher.register(DirectoryWatcher.java:400)
[error] at io.methvin.watcher.DirectoryWatcher.registerAll(DirectoryWatcher.java:373)
[error] at io.methvin.watcher.DirectoryWatcher.<init>(DirectoryWatcher.java:193)
[error] at io.methvin.watcher.DirectoryWatcher$Builder.build(DirectoryWatcher.java:122)
[error] at play.dev.filewatch.DefaultFileWatchService.watch(DefaultFileWatchService.scala:44)
[error] at play.dev.filewatch.FileWatchService$$anon$1.watch(FileWatchService.scala:95)
[error] at play.runsupport.Reloader.<init>(Reloader.scala:443)
[error] at play.runsupport.Reloader$.reloader$lzycompute$1(Reloader.scala:283)
[error] at play.runsupport.Reloader$.play$runsupport$Reloader$$reloader$1(Reloader.scala:275)
[error] at play.runsupport.Reloader$.startDevMode(Reloader.scala:301)
[error] at play.sbt.run.PlayRun$.devModeServer$lzycompute$1(PlayRun.scala:100)
[error] at play.sbt.run.PlayRun$.devModeServer$1(PlayRun.scala:83)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3(PlayRun.scala:107)
[error] at play.sbt.run.PlayRun$.$anonfun$playRunTask$3$adapted(PlayRun.scala:67)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] stack trace is suppressed; run last Compile / run for the full output
[error] (Compile / run) java.lang.UnsatisfiedLinkError: Can't load library: /Users/roozbeh.merandi/Library/Caches/JNA/temp/jna6522888454902179447.tmp
Related
It's been a while since I used Scala and Intellij. But I wanted to learn about Big Data, and I decided to start a course.
I have been trying to setup IntelliJ to run the first project. I installed openjdk 16 and scala 2.12.13.
I am able to run the project from terminal
$ sbt clean compile run
In IntelliJ I created an sbt task with the same commands, but I am getting the following error.
[info] running com.sundogsoftware.sparkstreaming.PrintTweets
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
[error] (run-main-1) java.lang.ExceptionInInitializerError
[error] java.lang.ExceptionInInitializerError
[error] at org.apache.spark.unsafe.array.ByteArrayMethods.<clinit>(ByteArrayMethods.java:54)
[error] at org.apache.spark.internal.config.package$.<init>(package.scala:1006)
[error] at org.apache.spark.internal.config.package$.<clinit>(package.scala)
[error] at org.apache.spark.SparkConf$.<init>(SparkConf.scala:639)
[error] at org.apache.spark.SparkConf$.<clinit>(SparkConf.scala)
[error] at org.apache.spark.SparkConf.set(SparkConf.scala:94)
[error] at org.apache.spark.SparkConf.set(SparkConf.scala:83)
[error] at org.apache.spark.SparkConf.setMaster(SparkConf.scala:115)
[error] at org.apache.spark.SparkContext$.updatedConf(SparkContext.scala:2698)
[error] at org.apache.spark.streaming.StreamingContext$.createNewSparkContext(StreamingContext.scala:862)
[error] at org.apache.spark.streaming.StreamingContext.<init>(StreamingContext.scala:101)
[error] at com.sundogsoftware.sparkstreaming.PrintTweets$.main(PrintTweets.scala:24)
[error] at com.sundogsoftware.sparkstreaming.PrintTweets.main(PrintTweets.scala)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[error] Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to unnamed module #3d8f7200
[error] at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
[error] at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
[error] at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
[error] at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
[error] at org.apache.spark.unsafe.Platform.<clinit>(Platform.java:56)
[error] at org.apache.spark.unsafe.array.ByteArrayMethods.<clinit>(ByteArrayMethods.java:54)
[error] at org.apache.spark.internal.config.package$.<init>(package.scala:1006)
[error] at org.apache.spark.internal.config.package$.<clinit>(package.scala)
[error] at org.apache.spark.SparkConf$.<init>(SparkConf.scala:639)
[error] at org.apache.spark.SparkConf$.<clinit>(SparkConf.scala)
[error] at org.apache.spark.SparkConf.set(SparkConf.scala:94)
[error] at org.apache.spark.SparkConf.set(SparkConf.scala:83)
[error] at org.apache.spark.SparkConf.setMaster(SparkConf.scala:115)
[error] at org.apache.spark.SparkContext$.updatedConf(SparkContext.scala:2698)
[error] at org.apache.spark.streaming.StreamingContext$.createNewSparkContext(StreamingContext.scala:862)
[error] at org.apache.spark.streaming.StreamingContext.<init>(StreamingContext.scala:101)
[error] at com.sundogsoftware.sparkstreaming.PrintTweets$.main(PrintTweets.scala:24)
[error] at com.sundogsoftware.sparkstreaming.PrintTweets.main(PrintTweets.scala)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
[error] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.base/java.lang.reflect.Method.invoke(Method.java:567)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
[error] Total time: 1 s, completed Apr 8, 2021, 8:17:21 AM
I am stuck, I have been trying to vary the setup, delete the .idea folder and invalidate cache/restart intellij. But I am always getting the same error.
I thought I would try out Scala.js 1.3.0, but I cannot get the tutorial at scalajs-tutorial to run following the instructions at Basic Turorial What I get is
[error] stack trace is suppressed; run last Compile / scalaJSIR for the full output
[error] (Compile / scalaJSIR) java.nio.file.FileSystemLoopException: G:\My Drive\Git\scalajs-tutorial\target\scala-2.13\classes\tutorial
[error] Total time: 15 s, completed Oct. 16, 2020, 9:24:08 a.m.
sbt:Scala.js Tutorial>
sbt:Scala.js Tutorial> last Compile / scalaJSIR
[error] java.nio.file.FileSystemLoopException: G:\My Drive\Git\scalajs-tutorial\target\scala-2.13\classes\tutorial
[error] at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:294)
[error] at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)
[error] at java.base/java.nio.file.Files.walkFileTree(Files.java:2840)
[error] at org.scalajs.linker.PathIRContainer$.org$scalajs$linker$PathIRContainer$$walkIR(PathIRContainer.scala:95)
[error] at org.scalajs.linker.PathIRContainer$.$anonfun$fromClasspath$4(PathIRContainer.scala:37)
[error] at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:877)
[error] at scala.collection.immutable.List.foreach(List.scala:392)
[error] at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:876)
[error] at org.scalajs.linker.PathIRContainer$.$anonfun$fromClasspath$2(PathIRContainer.scala:33)
[error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1$$anon$2.block(ExecutionContextImpl.scala:75)
[error] at java.base/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3127)
[error] at scala.concurrent.impl.ExecutionContextImpl$DefaultThreadFactory$$anon$1.blockOn(ExecutionContextImpl.scala:87)
[error] at scala.concurrent.package$.blocking(package.scala:146)
[error] at org.scalajs.linker.PathIRContainer$.$anonfun$fromClasspath$1(PathIRContainer.scala:33)
[error] at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error] at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error] at scala.util.Success.map(Try.scala:213)
[error] at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error] at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error] at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error] at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error] at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1429)
[error] at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[error] at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
[error] at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
[error] at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
[error] at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
[error] (Compile / scalaJSIR) java.nio.file.FileSystemLoopException: G:\My Drive\Git\scalajs-tutorial\target\scala-2.13\classes\tutorial
I don't know why there would be a loop in the file system, since I used git clone to get the repo.
So, the reason there may be a loop in the file system is that I was running the repo in a directory on Google Drive File Stream. This does not seem to be a safe place to build SBT projects...
Moving the repo to the C: drive on my local system solved that problem, but the project still fails to build/run... more to come on a different post...
I have cloned sbt project and it has compiled successfully and resolved all dependencies.
But when I run it or run a clean test, it gives the following compilation error:
[error] java.lang.NoSuchFieldError: O_TMPFILE
[error] at org.jruby.RubyFile.createFileClass(RubyFile.java:202)
[error] at org.jruby.Ruby.initCore(Ruby.java:1486)
[error] at org.jruby.Ruby.bootstrap(Ruby.java:1270)
[error] at org.jruby.Ruby.init(Ruby.java:1170)
[error] at org.jruby.Ruby.newInstance(Ruby.java:334)
[error] at org.jruby.javasupport.JavaEmbedUtils.initialize(JavaEmbedUtils.java:79)
[error] at org.asciidoctor.internal.JRubyAsciidoctor.createJRubyAsciidoctorInstance(JRubyAsciidoctor.java:126)
[error] at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:57)
[error] at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:668)
[error] at StreamApiBuild$.documentationGenerate(StreamApiBuild.scala:32)
[error] at $bb5b1f84bcb741e43d80$.$anonfun$StreamService$7(build.sbt:43)
[error] at sbt.std.Transform$$anon$3.$anonfun$apply$2(System.scala:46)
[error] at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:278)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (Compile / managedResources) java.lang.NoSuchFieldError: O_TMPFILE
There is no such file in our project O_TMPFILE.
But when i comment the following lines in my build.sbt, it works fine.
.settings(resourceGenerators in Compile += task[Seq[File]] {
documentationGenerate((resourceManaged in Compile).value, name.value, version.value, baseDirectory.value)
})
I need to understand the cause of the error and permanent fix. I have googled more than enough but it didn't solve my problem.
I guess that documentationGenerate uses jRuby internally, and jRuby has problem with java 11 (not sure if case here). My proposition is to run sbt using java8 and see what happens.
https://github.com/jruby/jruby/issues/5334
I am going through https://www.squeryl.org/download.html to figure out how to import Squeryl using SBT. There it is written to add just one line libraryDependencies += "org.squeryl" %% "squeryl" % "0.9.5-6" in the build.sbt. However, when I add that same line in the file and then run sbt run on the terminal, I get thrown an error sbt.librarymanagement.ResolveException: Error downloading org.squeryl:squeryl_2.13:0.9.5-6. I searched in Google for that error but it looks like no one else has ever had that issue before. Can someone please help me out with what can be done to resolve the issue?
The full error is pasted below in case it helps:
$ sbt run
[info] Loading settings for project taxonomy-build from plugins.sbt ...
[info] Loading project definition from /Users/s1b01g3/durden-temp/durden/services/taxonomy/project
[info] Loading settings for project root from build.sbt ...
[info] Set current project to taxonomy (in build file:/Users/s1b01g3/durden-temp/durden/services/taxonomy/)
[info] Updating
[info] Resolved dependencies
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading org.squeryl:squeryl_2.13:0.9.5-6
[error] Not found
[error] Not found
[error] not found: /Users/s1b01g3/.ivy2/local/org.squeryl/squeryl_2.13/0.9.5-6/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/org/squeryl/squeryl_2.13/0.9.5-6/squeryl_2.13-0.9.5-6.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:245)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$34(CoursierDependencyResolution.scala:214)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:214)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:52)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:102)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:69)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:115)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:115)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:96)
[error] at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:129)
[error] at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2946)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.squeryl:squeryl_2.13:0.9.5-6
[error] Not found
[error] Not found
[error] not found: /Users/s1b01g3/.ivy2/local/org.squeryl/squeryl_2.13/0.9.5-6/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/org/squeryl/squeryl_2.13/0.9.5-6/squeryl_2.13-0.9.5-6.pom
[error] Total time: 3 s, completed 17 Jan, 2020 4:19:54 PM
Any kind of help whatsoever would be highly appreciated. Thanks a lot.
The problem is that squeryl 0.9.5-6 was never released for Scala 2.13.
In such a case, just have a look at mvnrepository.com, searching for your artifact:
https://mvnrepository.com/artifact/org.squeryl/squeryl
The table tells you which version was published for Scala 2.13: 0.9.14
sbt gets stuck when trying to compile this project (snowplow/snowplow, branch sbt_issue) and goes OutOfMemory:
$ sbt compile
[info] Loading settings for project global-plugins from metals.sbt ...
[info] Loading global plugins from /home/ben/.sbt/1.0/plugins
[info] Loading settings for project beam-enrich-build from plugins.sbt ...
[info] Loading project definition from /home/ben/code/snowplow/3-enrich/beam-enrich/project
[info] Loading settings for project beam-enrich from build.sbt ...
[info] Set current project to beam-enrich (in build file:/home/ben/code/snowplow/3-enrich/beam-enrich/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] Compiling 5 Scala sources to /home/ben/code/snowplow/3-enrich/beam-enrich/target/scala-2.12/classes
[error] ## Exception when compiling 5 sources to /home/ben/code/snowplow/3-enrich/beam-enrich/target/scala-2.12/classes
[error] Java heap space
[error] scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2567)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1410)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error] scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1393)
[error] scala.reflect.internal.Trees$$Lambda$3568/531009023.apply(Unknown Source)
[error] scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1392)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error] scala.reflect.api.Trees$Transformer.transformValDef(Trees.scala:2578)
[error] scala.reflect.api.Trees$Transformer.$anonfun$transformValDefs$1(Trees.scala:2581)
[error] scala.reflect.api.Trees$Transformer.transformValDefs(Trees.scala:2581)
[error] scala.reflect.api.Trees$Transformer.$anonfun$transformValDefss$1(Trees.scala:2584)
[error] scala.reflect.api.Trees$Transformer.transformValDefss(Trees.scala:2584)
[error] scala.reflect.internal.Trees.$anonfun$itransform$2(Trees.scala:1398)
[error] scala.reflect.internal.Trees$$Lambda$3566/671842794.apply(Unknown Source)
[error] scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error] scala.reflect.internal.Trees.itransform(Trees.scala:1397)
[error] scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error]
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
[error] at java.util.concurrent.FutureTask.report(FutureTask.java:122)
[error] at java.util.concurrent.FutureTask.get(FutureTask.java:192)
[error] at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:213)
[error] at sbt.Execute.next$1(Execute.scala:110)
[error] at sbt.Execute.processAll(Execute.scala:113)
[error] at sbt.Execute.runKeep(Execute.scala:90)
[error] at sbt.EvaluateTask$.liftedTree1$1(EvaluateTask.scala:420)
[error] at sbt.EvaluateTask$.run$1(EvaluateTask.scala:419)
[error] at sbt.EvaluateTask$.runTask(EvaluateTask.scala:438)
[error] at sbt.internal.Aggregation$.$anonfun$timedRun$4(Aggregation.scala:99)
[error] at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:355)
[error] at sbt.internal.Aggregation$.timedRun(Aggregation.scala:97)
[error] at sbt.internal.Aggregation$.runTasks(Aggregation.scala:111)
[error] at sbt.internal.Aggregation$.$anonfun$applyTasks$1(Aggregation.scala:67)
[error] at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
[error] at sbt.internal.Aggregation$.$anonfun$evaluatingParser$11(Aggregation.scala:212)
[error] at sbt.internal.Act$.$anonfun$actParser0$3(Act.scala:435)
[error] at sbt.Command$.process(Command.scala:181)
[error] at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error] at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error] at sbt.State$$anon$1.runCmd$1(State.scala:246)
[error] at sbt.State$$anon$1.process(State.scala:250)
[error] at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.MainLoop$.next(MainLoop.scala:139)
[error] at sbt.MainLoop$.run(MainLoop.scala:132)
[error] at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
[error] at sbt.io.Using.apply(Using.scala:22)
[error] at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
[error] at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
[error] at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
[error] at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error] at sbt.StandardMain$.runManaged(Main.scala:138)
[error] at sbt.xMain.run(Main.scala:89)
[error] at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:111)
[error] at xsbt.boot.Launch$.withContextLoader(Launch.scala:130)
[error] at xsbt.boot.Launch$.run(Launch.scala:111)
[error] at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:37)
[error] at xsbt.boot.Launch$.launch(Launch.scala:119)
[error] at xsbt.boot.Launch$.apply(Launch.scala:20)
[error] at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error] at xsbt.boot.Boot$.main(Boot.scala:18)
[error] at xsbt.boot.Boot.main(Boot.scala)
[error] Caused by: java.lang.OutOfMemoryError: Java heap space
[error] at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2567)
[error] at scala.reflect.internal.Trees.itransform(Trees.scala:1410)
[error] at scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error] at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1393)
[error] at scala.reflect.internal.Trees$$Lambda$3568/531009023.apply(Unknown Source)
[error] at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error] at scala.reflect.internal.Trees.itransform(Trees.scala:1392)
[error] at scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1703)
[error] at scala.reflect.api.Trees$Transformer.transformValDef(Trees.scala:2578)
[error] at scala.reflect.api.Trees$Transformer.$anonfun$transformValDefs$1(Trees.scala:2581)
[error] at scala.reflect.api.Trees$Transformer.transformValDefs(Trees.scala:2581)
[error] at scala.reflect.api.Trees$Transformer.$anonfun$transformValDefss$1(Trees.scala:2584)
[error] at scala.reflect.api.Trees$Transformer.transformValDefss(Trees.scala:2584)
[error] at scala.reflect.internal.Trees.$anonfun$itransform$2(Trees.scala:1398)
[error] at scala.reflect.internal.Trees$$Lambda$3566/671842794.apply(Unknown Source)
[error] at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[error] at scala.reflect.internal.Trees.itransform(Trees.scala:1397)
[error] at scala.reflect.internal.Trees.itransform$(Trees.scala:1372)
[error] at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:27)
[error] at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[error] at scala.reflect.internal.Trees$Duplicator.transform(Trees.scala:1706)
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
[error] Use 'last' for the full log.
It was compiling well and quickly and the problem occured after I changed some return types of a few functions.
The issue first occurred on:
Debian Stretch
scala 2.12.8
sbt 1.2.8
java 1.8 (both openjdk and oracle jdk)
I tried several versions of Scala and sbt but same problem. The bug could be reproduced on Travis and on Mac OS.
I don't think that memory is the problem here, as I allocated plenty:
export SBT_OPTS="-Xms4G -Xmx8G -Xss8M -XX:MaxMetaspaceSize=2G -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
Any idea what could be wrong or how I could troubleshoot this?