We are using following dependencies for our project.
val cassandraConnector = "com.datastax.spark" %% "spark-cassandra-connector" % "2.0.0"
val sparkSql = "org.apache.spark" % "spark-sql_2.11" % "2.2.0"
val phantomDsl = "com.outworkers" % "phantom-dsl_2.11" % "2.15.5"
val cassandraUnit = "org.cassandraunit" % "cassandra-unit" % "3.3.0.2" % "test"
While running the test cases using the command sbt compile test.
We are getting following error:-
[error] java.lang.IncompatibleClassChangeError: Class com.datastax.driver.core.DefaultResultSetFuture does not implement the requested interface com.google.common.util.concurrent.ListenableFuture
[error] at com.google.common.util.concurrent.Futures.addCallback(Futures.java:1776)
[error] at com.outworkers.phantom.builder.query.execution.PromiseInterface$$anon$1.fromGuava(ExactlyOncePromise.scala:56)
[error] at com.outworkers.phantom.builder.query.execution.PromiseInterface$$anon$1.fromGuava(ExactlyOncePromise.scala:63)
[error] at com.outworkers.phantom.builder.query.execution.GuavaAdapter$class.fromGuava(ExecutableStatements.scala:44)
[error] at com.outworkers.phantom.builder.query.execution.PromiseInterface$$anon$1.fromGuava(ExactlyOncePromise.scala:39)
[error] at com.outworkers.phantom.builder.query.execution.ExecutableStatements$$anonfun$future$1.apply(ExecutableStatements.scala:112)
[error] at com.outworkers.phantom.builder.query.execution.ExecutableStatements$$anonfun$future$1.apply(ExecutableStatements.scala:110)
[error] at scala.collection.immutable.List.foreach(List.scala:381)
[error] at com.outworkers.phantom.builder.query.execution.ExecutableStatements.future(ExecutableStatements.scala:110)
[error] at com.outworkers.phantom.ops.DbOps.truncateAsync(DbOps.scala:104)
[error] at com.outworkers.phantom.ops.DbOps.truncate(DbOps.scala:94)
[error] at com.knoldus.cassandra.CassandraDatabaseCluster$class.afterAll(CassandraDatabaseCluster.scala:29)
[error] at com.knoldus.model.PredicateHashingSuite.afterAll(PredicateHashingSuite.scala:7)
[error] at org.scalatest.BeforeAndAfterAll$$anonfun$1.apply$mcV$sp(BeforeAndAfterAll.scala:225)
[error] at org.scalatest.Status$$anonfun$withAfterEffect$1.apply(Status.scala:379)
[error] at org.scalatest.Status$$anonfun$withAfterEffect$1.apply(Status.scala:375)
[error] at org.scalatest.FailedStatus$.whenCompleted(Status.scala:497)
[error] at org.scalatest.Status$class.withAfterEffect(Status.scala:375)
[error] at org.scalatest.FailedStatus$.withAfterEffect(Status.scala:469)
[error] at org.scalatest.BeforeAndAfterAll$class.run(BeforeAndAfterAll.scala:223)
[error] at com.knoldus.model.PredicateHashingSuite.run(PredicateHashingSuite.scala:7)
[error] at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:314)
[error] at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:480)
[error] at sbt.TestRunner.runTest$1(TestFramework.scala:102)
[error] at sbt.TestRunner.run(TestFramework.scala:113)
[error] at sbt.TestFramework$$anon$2$$anonfun$$lessinit$greater$1.$anonfun$apply$1(TestFramework.scala:258)
[error] at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:229)
[error] at sbt.TestFramework$$anon$2$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:258)
[error] at sbt.TestFramework$$anon$2$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:258)
[error] at sbt.TestFunction.apply(TestFramework.scala:267)
[error] at sbt.Tests$.$anonfun$toTask$1(Tests.scala:276)
[error] at sbt.std.Transform$$anon$3.$anonfun$apply$2(System.scala:44)
[error] at sbt.std.Transform$$anon$4.work(System.scala:64)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:266)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[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)
Is there something wrong within dependency?
How can we get rid of this error?
Thanks
That's really interesting, however it's not to do with phantom, it's to do with the Guava Library dependency that somehow ends up clashing with what is on the classpath.
In short, basically the problem comes from a binary incompatibility/exclusion, so Spark or something else in your classpath overrides the version of Guava in phantom.
If you print out evictions I can help you further.
We also offer phantom-sbt as an integrated SBT plugin for Cassandra, which I would suspect as the root cause here, as well as a Docker integration via SBT(pro only feature). Maybe file a GitHub issue for phantom, and we can follow up there more easily as soon as we know which versions clash.
Related
We upgrade an older system to newer Version of Play (Scala 2.12.8 -> 2.13.5, Play 2.6 -> 2.8)
and now I have this line of Code:
Ok.chunked(Source.fromPublisher(IterateeStreams.enumeratorToPublisher(MyEnumerator))).withHeaders(...)
In the new project the IterateeStreams seems to be missing, but when I try to add the dependency with
libraryDependencies += ....
"com.typesafe.play" %% "play-iteratees" % "2.6.1"
"com.typesafe.play" %% "play-iteratees-reactive-streams" % "2.6.1"
the download fails. I also tried the akka Streams described in https://www.playframework.com/documentation/2.8.x/StreamsMigration25
But IntelliJ also doesn't knows the "Stream" class. (import akka._ in the class).
I tried playing around with dependecies and stuff, but it seems I can't make it and now I am confused.
I'm still very new to Scala/Play (startet two weeks ago), so may be I just do some rookie-mistakes here...
Error:
$ compile
[info] Updating
[info] Resolved dependencies
[warn]
[warn] Note: Unresolved dependencies path:
[error] stack trace is suppressed; run last update for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:play-iteratees-reactive-streams_2.13:2.6.1
[error] Not found
[error] Not found
[error] not found: /home/******/.ivy2/local/com.typesafe.play/play-iteratees-reactive-streams_2.13/2.6.1/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] not found: https://dl.bintray.com/scalaz/releases/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] not found: https://repo.akka.io/snapshots/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] Total time: 4 s, completed 26.04.2021, 12:40:02
[myProject] $ last update
[debug] "not up to date. inChanged = true, force = false
[debug] Updating ...
[info] Updating
[info] Resolved dependencies
[warn]
[warn] Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:play-iteratees-reactive-streams_2.13:2.6.1
[error] Not found
[error] Not found
[error] not found: /home/*******/.ivy2/local/com.typesafe.play/play-iteratees-reactive-streams_2.13/2.6.1/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] not found: https://dl.bintray.com/scalaz/releases/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] not found: https://repo.akka.io/snapshots/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:247)
[error] at lmcoursier.CoursierDependencyResolution.$anonfun$update$35(CoursierDependencyResolution.scala:216)
[error] at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:216)
[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:2950)
[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.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] at java.base/java.lang.Thread.run(Thread.java:834)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:play-iteratees-reactive-streams_2.13:2.6.1
[error] Not found
[error] Not found
[error] not found: /home/******/.ivy2/local/com.typesafe.play/play-iteratees-reactive-streams_2.13/2.6.1/ivys/ivy.xml
[error] not found: https://repo1.maven.org/maven2/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] not found: https://dl.bintray.com/scalaz/releases/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
[error] not found: https://repo.akka.io/snapshots/com/typesafe/play/play-iteratees-reactive-streams_2.13/2.6.1/play-iteratees-reactive-streams_2.13-2.6.1.pom
It looks like it's trying the default resolver first, and then the custom resolvers. But as far as I understood this, the default one should work.
Btw.: The same dependency was used in the old project in the same way.
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
I am trying to call some clojure code as a sbt task.
My build.sbt looks like,
lazy val aTask = taskKey[Unit]("a task")
libraryDependencies ++= Seq(
"org.clojure" % "clojure" % "1.9.0"
)
import clojure.java.api.Clojure
import clojure.lang.IFn
aTask := {
val plus: IFn = Clojure.`var`("clojure.core", "+")
println(plus.invoke(1, 4))
}
Contents of project/build.sbt
resolvers += Resolver.mavenLocal
libraryDependencies ++= Seq(
"org.clojure" % "clojure" % "1.9.0"
)
Also I have added clojure dep in project/build.sbt of my project.
I am getting the following error when calling the task
[error] java.lang.ExceptionInInitializerError
[error] at clojure.lang.Namespace.<init>(Namespace.java:34)
[error] at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
[error] at clojure.lang.Var.intern(Var.java:148)
[error] at clojure.java.api.Clojure.var(Clojure.java:82)
[error] at clojure.java.api.Clojure.<clinit>(Clojure.java:96)
[error] at $2d5a9b65ddee7e6a09cc$.$anonfun$$sbtdef$1(build.sbt:20)
[error] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] at sbt.std.Transform$$anon$3.$anonfun$apply$2(System.scala:46)
[error] at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:271)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[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] Caused by: java.io.FileNotFoundException: Could not locate clojure/core__init.class or clojure/core.clj on classpath.
[error] at clojure.lang.RT.load(RT.java:463)
[error] at clojure.lang.RT.load(RT.java:426)
[error] at clojure.lang.RT.doInit(RT.java:468)
[error] at clojure.lang.RT.<clinit>(RT.java:336)
Any pointers on what I could try would be helpful.
I think there is an issue with class loaders setup by sbt. Clojure's RT class loads Clojure namespaces/classes using class loaders API. If sbt configures the classloaders hierarchy and class loading strategy (e.g. parent first) in a way that RT's classloader doesn't find Clojure's classes via classloader it's using then it will fail with the error you are getting.
Unfortunately, I don't know sbt internals to determine how the classloaders get configured. Maybe another question would help in the investigation: How to display classpath used for run task?