NoSuchMethodError revisited

470 views
Skip to first unread message

Nolan Darilek

unread,
Jul 22, 2013, 2:26:28 PM7/22/13
to sca...@googlegroups.com
Getting the below exception when trying to run Scalate 1.6.1 under Scala
2.10.2 and 2.10.1. Things used to work but now they don't. Unfortunately
I'm picking up this project again after a couple months so am not sure
what changed.

I've seen this:

https://groups.google.com/forum/#!topic/scalate/LO3KTaVTH2U

But I can't think what on my classpath is potentially inconsistent. I
only see Scala 2.10.2 or 2.10.1 jars on my system when I poke around in
~/.gradle.

Other thoughts? This line is what does it:

val template = engine.load("/emails/welcome.jade", List(
Binding("url", "String")
))

Thanks.

[ERROR] [07/22/2013 13:06:03.964]
[default-akka.actor.default-dispatcher-6] [akka://default/user/$a]
scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;
org.fusesource.scalate.TemplateException:
scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;
at
org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:732)
at
org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:699)
at
org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:419)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:413)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:471)
at
code.Mailer$$anonfun$code$Mailer$$sendWelcomeEmail$1.apply(Mailer.scala:65)
at
code.Mailer$$anonfun$code$Mailer$$sendWelcomeEmail$1.apply(Mailer.scala:64)
at scala.Option.foreach(Option.scala:236)
at code.Mailer.code$Mailer$$sendWelcomeEmail(Mailer.scala:64)
at code.Mailer$$anonfun$receive$1.applyOrElse(Mailer.scala:91)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
at akka.actor.ActorCell.invoke(ActorCell.scala:386)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
at akka.dispatch.Mailbox.run(Mailbox.scala:212)
at
akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:502)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.NoSuchMethodError:
scala.reflect.internal.TreeInfo.firstArgument(Lscala/reflect/internal/Trees$Tree;)Lscala/reflect/internal/Trees$Tree;
at
scala.tools.nsc.typechecker.Typers$Typer.parentTypes(Typers.scala:1550)
at
scala.tools.nsc.typechecker.Namers$Namer.templateSig(Namers.scala:861)
at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1300)
at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1347)
at
scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:709)
at
scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708)
at
scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708)
at
scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1385)
at
scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:708)
at
scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:707)
at
scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1496)
at
scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1504)
at
scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1494)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1229)
at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1365)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5119)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5458)
at
scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2770)
at
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2870)
at
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2870)
at scala.collection.immutable.List.loop$1(List.scala:170)
at scala.collection.immutable.List.mapConserve(List.scala:186)
at
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2870)
at
scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5127)
at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5404)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5458)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5509)
at
scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
at
scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90)
at
scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:90)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at
scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:90)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1574)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1548)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1544)
at scala.tools.nsc.Global$Run.compile(Global.scala:1654)
at
org.fusesource.scalate.support.ScalaCompiler.compile(ScalaCompiler.scala:100)
at
org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:757)
... 18 more

Rafał Krzewski

unread,
Jul 23, 2013, 7:51:20 AM7/23/13
to sca...@googlegroups.com
My advice from the linked thread applies here as well. You need to examine your runtime classpath carefully.

Cheers,
Rafał

Nolan Darilek

unread,
Jul 23, 2013, 10:55:02 AM7/23/13
to sca...@googlegroups.com
What am I looking for specifically? Just mismatched versions of Scala? Pretty sure I only saw 2.10.2 everywhere but will look again. Jars other than 2.10.2 aren't even in the cache.

Is there any way to check for this error in the library and return a more intelligent error message? This isn't the first Scala library I've used, but it is the first that has had issues when everything I think I'm running is 2.10.0+.

Thanks.

Rafał Krzewski

unread,
Jul 23, 2013, 12:13:57 PM7/23/13
to sca...@googlegroups.com
2.10.2? Gotcha. Scalate 1.6.1 was compiled against Scala 2.10.0, and Scalate depends on scala-compiler.jar and scala-refelction.jar which are NOT compatible across 2.10.x releases.
You need to use Scala 2.10.0 OR compile Scalate 1.7.0-SNAPSHOT (from scala_2.10 branch) locally and use that instead. I've updated the pom.xml recently to use Scala 2.10.2 https://github.com/scalate/scalate/commit/e14aae0
I know that we probably should have a 1.6.2 release using Scala 2.10.2 but I don't have the power to make it and project owners apparently are busy with other things :(

Regards,
Rafał
Reply all
Reply to author
Forward
0 new messages