scala-plotly-client icon indicating copy to clipboard operation
scala-plotly-client copied to clipboard

java.lang.NoSuchMethodError issue

Open gitPratikSingh opened this issue 7 years ago • 2 comments

Hi, I am getting this error when I tried to run the sample in your readme file.

"Exception in thread "main" java.lang.NoSuchMethodError: co.theasi.plotly.writer.Server.$init$(Lco/theasi/plotly/writer/Server;)V"

Platform: Windows 10 Scala version: Scala 2.10

Does scala plotly client work in Windows?

gitPratikSingh avatar May 12 '18 05:05 gitPratikSingh

I see no reason it would not work on Windows. It only supports Scala 2.11 and 2.12, however.

pbugnion avatar May 12 '18 06:05 pbugnion

Machine: Scala 2.12.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_144.

Upgraded to Scala 2.12, but the issue did not get resolved. Providing more detailsif this helps

Code:

import co.theasi.plotly.writer.Server
import co.theasi.plotly.{Plot, draw, writer}

implicit val server = new Server {
  val credentials = writer.Credentials("YYYYYY", "XXXXXXXXXXXXXXXXXXX")
  val url = "https://api.plot.ly/v2/"
}

val p = Plot().withScatter(Vector(1, 2), Vector(3, 4))
draw(p, "custom-credentials")

Error message: java.lang.NoSuchMethodError: co.theasi.plotly.writer.Server.$init$(Lco/theasi/plotly/writer/Server;)V at #worksheet#.$anon$1.(test.sc:5) at #worksheet#.server$lzycompute(test.sc:5) at #worksheet#.server(test.sc:5) at #worksheet#.get$$instance$$server(test.sc:5) at #worksheet#.#worksheet#(test.sc:22)

(Note- I am running this on the IntelliJ worksheet)

gitPratikSingh avatar May 12 '18 18:05 gitPratikSingh