Can't build a simple project with Lift and Scala.js - scala.js

I made this simple project: https://github.com/eje211/scalajswithlift
I tried to create a JSON object with Lift DSL and print it in the HTML console with Scala.js . But I get this error:
[info] Compiling 1 Scala source to /Users/eeytan/src/scalajs/target/scala-2.11/classes...
[info] Fast optimizing /Users/eeytan/src/scalajs/target/scala-2.11/scala-js-tutorial-fastopt.js
[error] Referring to non-existent class Lnet_liftweb_json_JsonDSL$
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent class Lnet_liftweb_json_package$
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent class Lnet_liftweb_json_JsonAST$
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent method Lnet_liftweb_json_JsonAST$.render__Lnet_liftweb_json_JsonAST$JValue__s_text_Document
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent method Lnet_liftweb_json_JsonDSL$.int2jvalue__I__Lnet_liftweb_json_JsonAST$JInt
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent method Lnet_liftweb_json_JsonDSL$.pair2Assoc__T2__F1__Lnet_liftweb_json_JsonDSL$JsonAssoc
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent method Lnet_liftweb_json_JsonDSL$.string2jvalue__T__Lnet_liftweb_json_JsonAST$JString
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[error] Referring to non-existent method Lnet_liftweb_json_package$.pretty__s_text_Document__T
[error] called from Ltutorial_webapp_TutorialApp$.main__V
[error] called from sjs_js_JSApp$class.$$js$exported$meth$main__sjs_js_JSApp__O
[error] called from Ltutorial_webapp_TutorialApp$.$$js$exported$meth$main__O
[error] called from Ltutorial_webapp_TutorialApp$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] Ltutorial_webapp_TutorialApp$
[trace] Stack trace suppressed: run last compile:fastOptJS for the full output.
[error] (compile:fastOptJS) There were linking errors
[error] Total time: 1 s, completed Oct 30, 2015 5:21:03 PM
I don't understand why.
If I remove the comment from build.sbt, I get this error:
> ~fastOptJS
[trace] Stack trace suppressed: run last compile:scalaJSPreLinkClasspath for the full output.
[error] (compile:scalaJSPreLinkClasspath) org.scalajs.core.tools.classpath.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Ambiguous reference to a JS library: jquery.js
[error] Possible paths found on the classpath:
[error] - scala/tools/nsc/doc/html/resource/lib/jquery.js
[error] - META-INF/resources/webjars/jquery/2.1.3/jquery.js
[error] originating from: scalajs:compile
[error] Total time: 1 s, completed Oct 30, 2015 5:35:09 PM
I don't understand what's going on. Can't I use the Lift JSON DSL in Scala.js?

Lift, and Lift JSON, are JVM-only projects. They have not been ported/built for Scala.js, as far as I know. So no, you cannot use them in Scala.js.
In general, libraries need to be cross-compiled and published for both Scala/JVM and Scala.js for you to be able to use them. If it makes sense, you could ask Lift developers to cross-compile (some of) their libraries.
That said, in Scala.js, you could typically use JS APIs to work with JSON data structures:
import scala.scalajs.js
import js.Dynamic.{literal => lit}
val j = lit(a = 2, b = "Hello.")
println(js.JSON.stringify(j, space = 2))
Moreover, typically, you wouldn't even manipulate JSON directly at all. Instead, you would use any of the serialization libraries available for Scala.js, such as uPickle, Prickle or BooPickle.

Related

ScalaJs + ZIO: Program works with sbt 1.2.8 but not >= 1.3

I'm trying out scala.js with zio using the sample app at
https://github.com/wongelz/zio-scalajs-solarsystem
as soon as I update the sbt version from 1.2.8 to 1.3.13 or 1.4.4 I'm getting the following error:
[error] Referring to non-existent method java.time.LocalTime$.NANOS_PER_SECOND()long
[error] called from private java.time.LocalDateTime.plusWithOverflow(java.time.LocalDate,long,long,long,long,int)java.time.LocalDateTime
[error] called from java.time.LocalDateTime.plusNanos(long)java.time.LocalDateTime
[error] called from java.time.LocalDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.LocalDateTime
[error] called from java.time.LocalDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.temporal.Temporal
[error] called from java.time.temporal.ChronoUnit.addTo(java.time.temporal.Temporal,long)java.time.temporal.Temporal
[error] called from java.time.OffsetDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.OffsetDateTime
[error] called from java.time.OffsetDateTime.plus(long,java.time.temporal.TemporalUnit)java.time.temporal.Temporal
[error] called from java.time.Duration.addTo(java.time.temporal.Temporal)java.time.temporal.Temporal
[error] called from java.time.OffsetDateTime.plus(java.time.temporal.TemporalAmount)java.time.OffsetDateTime
[error] called from private zio.Schedule$.$anonfun$fixed$2(scala.Option,java.time.OffsetDateTime,long,java.time.Duration,long,scala.runtime.LazyRef)zio.Schedule$Decision
[error] called from private zio.Schedule$.$anonfun$fixed$1(scala.Option,long,java.time.Duration,long,scala.runtime.LazyRef,java.time.OffsetDateTime,java.lang.Object)zio.ZIO
[error] called from private zio.Schedule$.loop$23(scala.Option,long,long,java.time.Duration,scala.runtime.LazyRef)scala.Function2
[error] called from zio.Schedule$.fixed(java.time.Duration)zio.Schedule
[error] called from private SolarSystemExample$.$anonfun$run$1(SolarSystemExample$SolarSystem)zio.ZIO
[error] called from SolarSystemExample$.run(scala.collection.immutable.List)zio.ZIO
[error] called from private zio.App.$anonfun$main$1([java.lang.String)zio.ZIO
[error] called from zio.App.main([java.lang.String)void
[error] called from SolarSystemExample$.main([java.lang.String)void
[error] called from static SolarSystemExample.main([java.lang.String)void
[error] called from core module module initializers
[error] involving instantiated classes:
[error] java.time.LocalDateTime
[error] java.time.temporal.ChronoUnit
[error] java.time.OffsetDateTime
[error] java.time.Duration
[error] zio.Schedule$
[error] SolarSystemExample$
Why does this bug happen? And where should I report it?
To answer my own question (for anybody strugling with the same problem):
Make sure you don't have scalajs-java-time (1.0.0) as a dependency in your classpath.
It is a incomplete library and if it is picked before scala-java-time you will receive the error posted in the question.
The reason this error occurred, was, that at least on my system, the ordering of the classpath changed from sbt 1.2.8 to sbt 1.3.x, which resulted in the scalajs-java-time library being picked before scala-java-time which resulted in the
Referring to non-existent method java.time.LocalTime$.NANOS_PER_SECOND()long
Error

How can I get the Scala.js 1.3.0 tutorial to run?

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...

How to use scala.sys.process with scala.js

I have imported scala.sys.process._ into my scala.js project. That alone doesn't cause any problems, but if I add a simple command such as println("ls".!!) I get a gazillion errors, such as
[error] Referring to non-existent class java.lang.ProcessBuilder
[error] called from scala.sys.process.ProcessCreation.apply(scala.collection.Seq,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.Process$.apply(scala.collection.Seq,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.ProcessCreation.apply(java.lang.String,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.Process$.apply(java.lang.String,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.ProcessCreation.apply(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.Process$.apply(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.ProcessImplicits.stringToProcess(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.package$.stringToProcess(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from draw.Main$.main(org.scalajs.dom.raw.HTMLCanvasElement)scala.Unit
[error] called from draw.Main$.$$js$exported$meth$main(org.scalajs.dom.raw.HTMLCanvasElement)java.lang.Object
[error] called from draw.Main$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] scala.sys.process.Process$
[error] scala.sys.process.package$
[error] draw.Main$
[error] Referring to non-existent class java.io.File
[error] called from scala.sys.process.ProcessCreation.apply(scala.collection.Seq,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.Process$.apply(scala.collection.Seq,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.ProcessCreation.apply(java.lang.String,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.Process$.apply(java.lang.String,scala.Option,scala.collection.Seq)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.ProcessCreation.apply(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.Process$.apply(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.ProcessImplicits.stringToProcess(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from scala.sys.process.package$.stringToProcess(java.lang.String)scala.sys.process.ProcessBuilder
[error] called from draw.Main$.main(org.scalajs.dom.raw.HTMLCanvasElement)scala.Unit
[error] called from draw.Main$.$$js$exported$meth$main(org.scalajs.dom.raw.HTMLCanvasElement)java.lang.Object
[error] called from draw.Main$.main
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] scala.sys.process.Process$
[error] scala.sys.process.package$
[error] draw.Main$
[error] Referring to non-existent method java.lang.ProcessBuilder.environment()java.util.Map
Importing extra classes such as java.lang.ProcessBuilder and java.io.File has no impact on the content of these errors. Is there something very simple that I am missing here?
Thanks!
You can't simply import arbitrary Scala libraries into Scala.js -- while the language is the same, the environment is very different. Many standard Scala libraries simply don't exist in the SJS world, and many of them can't, because of the limitations of the JavaScript environment it runs in. It's syntactically legal, so it will compile, but it can't run before there isn't a Scala.js version of the library.
By and large, you should assume that libraries like this don't exist in the SJS world, unless you find that someone has specifically ported it. (I honestly don't know whether someone has ported scala.sys.process for Node.js; it doesn't make much sense in the browser environment...)

Linker error in ScalaJS: "Referring to non-existent class"

I am getting a bunch of linker errors when trying to link to FastParse in a Scala project which I've just tried to build a ScalaJS web app in.
I added the ScalaJS dependency for FastParse into my build.sbt: here's approximately the relevant line (full file here):
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "fastparse" % "0.4.1"
)
My errors are voluminous, but here's a representative one:
[error] Referring to non-existent class fastparse.Implicits$Repeater$
[error] called from parsers.MainParser$$anonfun$impls$1.apply()fastparse.core.Parser
[error] called from parsers.MainParser$$anonfun$impls$1.apply()java.lang.Object
[error] called from scala.Option.getOrElse(scala.Function0)java.lang.Object
[error] called from fastparse.StringReprOps$.errorMessage(fastparse.utils.ParserInput,java.lang.String,scala.Int)java.lang.String
[error] called from fastparse.core.ParseError.<init>(fastparse.core.Parsed$Failure)
[error] called from fastparse.Api.<init>(scala.reflect.ClassTag,fastparse.utils.ElemSetHelper,fastparse.utils.ReprOps,scala.math.Ordering)
[error] called from fastparse.StringApi.<init>()
[error] called from fastparse.all$.<init>()
[error] called from parsers.MainParser$.<init>()
[error] called from webapp.WebApp$.makeChoices(java.lang.String,java.lang.String)scala.collection.immutable.List
[error] called from webapp.WebApp$.$$js$exported$meth$makeChoices(java.lang.String,java.lang.String)java.lang.Object
[error] called from webapp.WebApp$.makeChoices
[error] exported to JavaScript with #JSExport
[error] involving instantiated classes:
[error] parsers.MainParser$$anonfun$impls$1
[error] scala.None$
[error] scala.Some
[error] fastparse.StringReprOps$
[error] webapp.WebApp$
What am I doing wrong?
The problem was that I was requiring the JVM version of FastParse two lines up in my build.sbt. This broke my build apparently. I removed that line and cleaned my build and now both the ScalaJS and ScalaJVM versions of the project are building nicely.
(Thanks heaps to Li Haoyi for spotting the problem for me)

Scaladoc (2.11.6) fails on throws tag with "unable to find any member to link"

When attempting to publish the jars for my project via sbt "++2.11.6 publishLocal" or sbt +publishLocal, I encounter Scaladoc issues when publishing for Scala 2.11.6. It appears that I have invalid links caused by the #throws tag. I am not sure why I have invalid links nor why the error only occurs for Scala 2.11.6 while not for Scala 2.10.5 during my cross-publishing. I can't find any indication that the #throws tag is not supported on Scala 2.11; so, I'm assuming it is an issue with my Scaladoc, but I don't know what I am missing at this point. Can anyone give me some insight into this issue?
/**
* Attempts to load the JDI, asserting that it can be and is loaded.
*
* #throws AssertionError If failed to load the JDI
*/
#throws(classOf[AssertionError])
protected def assertJdiLoaded(): Unit =
assert(jdiLoader.tryLoadJdi(),
"""
|Unable to load Java Debugger Interface! This is part of tools.jar
|provided by OpenJDK/Oracle JDK and is the core of the debugger! Please
|make sure that JAVA_HOME has been set and that tools.jar is available
|on the classpath!
""".stripMargin.replace("\n", " "))
The snippet above (one of the reported problems) is part of the file from my project here: https://github.com/rcsenkbeil/scala-debugger/blob/master/scala-debugger-api/src/main/scala/org/senkbeil/debugger/Debugger.scala#L22
The actual series of Scaladoc compilation errors is as follows:
[info] Loading project definition from /home/senkwich/projects/scala-debugger/project
[info] Set current project to scala-debugger (in build file:/home/senkwich/projects/scala-debugger/)
[info] Setting version to 2.11.6
[info] Reapplying settings...
[info] Set current project to scala-debugger (in build file:/home/senkwich/projects/scala-debugger/)
[info] Wrote /home/senkwich/projects/scala-debugger/scala-debugger-api/target/scala-2.11/scala-debugger-api_2.11-1.0.0.pom
[info] :: delivering :: org.senkbeil#scala-debugger-api_2.11;1.0.0 :: 1.0.0 :: release :: Sat Jul 18 00:59:01 CDT 2015
[info] delivering ivy file to /home/senkwich/projects/scala-debugger/scala-debugger-api/target/scala-2.11/ivy-1.0.0.xml
[info] Main Scala API documentation to /home/senkwich/projects/scala-debugger/scala-debugger-api/target/scala-2.11/api...
model contains 35 documentable templates
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:170: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:192: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:158: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:138: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:126: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:106: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:94: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/VirtualMachineWrapper.scala:73: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:112: Could not find any member to link for "IllegalArgumentException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:87: Could not find any member to link for "IllegalArgumentException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:54: Could not find any member to link for "IllegalArgumentException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/wrappers/ValueWrapper.scala:33: Could not find any member to link for "Throwable".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/jdi/JDILoader.scala:206: Could not find any member to link for "ClassNotFoundException".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:138: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:156: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:110: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:92: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/breakpoints/BreakpointBundle.scala:72: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] /home/senkwich/projects/scala-debugger/scala-debugger-api/src/main/scala/org/senkbeil/debugger/Debugger.scala:19: Could not find any member to link for "AssertionError".
[error] /**
[error] ^
[error] 19 errors found
[error] (scalaDebuggerApi/compile:doc) Scaladoc generation failed
[error] Total time: 17 s, completed Jul 18, 2015 12:59:17 AM
Based on discussion here, I have decided to suppress the errors for now by adding the Scaladoc option -no-link-warnings.
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc #throws links
)
Note that if you don't need scaladoc-s at all, you can make them empty:
sources in (Compile,doc) := Seq.empty
And not publish at all:
publishArtifact in packageDoc := false
I couldn't get the -no-link-warnings option to work. I ended up removing the scaladoc and added an annotation instead.
/** doc
*/
#throws[AssertionError]
The advantage with this is the info is also in the class file. But it's was pretty tedious to update everything.