Note that there are some explanatory texts on larger screens.

plurals
  1. POjava.lang.NoSuchMethodError in Scalatra using Scalate with Markdown
    primarykey
    data
    text
    <p>So I have a Scalatra app (using Scalatra 2.2.1). I'm building views using Scalate; I've decided to go with the Jade/Markdown one-two. Only one problem: if I try to use markdown in a jade template (started with the <code>:markdown</code> tag), I get this:</p> <pre><code>scala.Predef$.any2ArrowAssoc(Ljava/lang/Object;)Lscala/Predef$ArrowAssoc; java.lang.NoSuchMethodError: scala.Predef$.any2ArrowAssoc(Ljava/lang/Object;)Lscala/Predef$ArrowAssoc; at org.fusesource.scalamd.Markdown$.&lt;init&gt;(md.scala:119) at org.fusesource.scalamd.Markdown$.&lt;clinit&gt;(md.scala:-1) at org.fusesource.scalate.filter.ScalaMarkdownFilter$.filter(ScalaMarkdownFilter.scala:32) at org.fusesource.scalate.RenderContext$class.filter(RenderContext.scala:276) at org.fusesource.scalate.DefaultRenderContext.filter(DefaultRenderContext.scala:30) at org.fusesource.scalate.RenderContext$class.value(RenderContext.scala:235) at org.fusesource.scalate.DefaultRenderContext.value(DefaultRenderContext.scala:30) at templates.views.$_scalate_$about_jade$.$_scalate_$render(about_jade.scala:37) at templates.views.$_scalate_$about_jade.render(about_jade.scala:48) at org.fusesource.scalate.DefaultRenderContext.capture(DefaultRenderContext.scala:92) at org.fusesource.scalate.layout.DefaultLayoutStrategy.layout(DefaultLayoutStrategy.scala:45) at org.fusesource.scalate.TemplateEngine$$anonfun$layout$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(TemplateEngine.scala:559) at org.fusesource.scalate.TemplateEngine$$anonfun$layout$1$$anonfun$apply$mcV$sp$1.apply(TemplateEngine.scala:559) at org.fusesource.scalate.TemplateEngine$$anonfun$layout$1$$anonfun$apply$mcV$sp$1.apply(TemplateEngine.scala:559) </code></pre> <p>So that's pretty cool. The error vanishes as soon as I remove the <code>:markdown</code> flag, and beyond that everything compiles (beyond markdown not getting rendered correctly).</p> <p>Things I know and have found so far:</p> <ol> <li>There's some thought that this error is the biproduct of incompatible Scala versions somewhere in the build. My build.scala defines Scala version as 2.10.0, which Scalatra is explicitly compatible with.</li> <li>...that said, I have <em>no idea</em> which version of Scalate Scalatra pulls in, and my attempts to override it have not worked so far. I know the current stable of Scalate (1.6.1) is only compatible up to Scala 2.10.0 -- but that's what I'm using.</li> <li>I am, however, sure that my classpath is clean. I have no conflicting Scala versions. <em>Everything</em> is 2.10.0 in the dependencies. </li> </ol> <p>Has anybody worked with this one before? Any ideas? </p> <h3>EDIT</h3> <p>Per request, here are my build definitions:</p> <pre><code>//build.sbt libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M5b" % "test" libraryDependencies += "org.twitter4j" % "twitter4j-core" % "3.0.3" libraryDependencies += "org.fusesource.scalamd" % "scalamd" % "1.5" //build.properties sbt.version=0.12.3 //build.scala import sbt._ import Keys._ import org.scalatra.sbt._ import org.scalatra.sbt.PluginKeys._ import com.mojolly.scalate.ScalatePlugin._ import ScalateKeys._ object TheRangeBuild extends Build { val Organization = "com.gastove" val Name = "The Range" val Version = "0.1.0-SNAPSHOT" val ScalaVersion = "2.10.0" val ScalatraVersion = "2.2.1" lazy val project = Project ( "the-range", file("."), settings = Defaults.defaultSettings ++ ScalatraPlugin.scalatraWithJRebel ++ scalateSettings ++ Seq( organization := Organization, name := Name, version := Version, scalaVersion := ScalaVersion, resolvers += Classpaths.typesafeReleases, libraryDependencies ++= Seq( "org.scalatra" %% "scalatra" % ScalatraVersion, "org.scalatra" %% "scalatra-scalate" % ScalatraVersion, "org.scalatra" %% "scalatra-specs2" % ScalatraVersion % "test", "ch.qos.logback" % "logback-classic" % "1.0.6" % "runtime", "org.eclipse.jetty" % "jetty-webapp" % "8.1.8.v20121106" % "compile;container", "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "compile;container;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar")) ), scalateTemplateConfig in Compile &lt;&lt;= (sourceDirectory in Compile){ base =&gt; Seq( TemplateConfig( base / "webapp" / "WEB-INF" / "templates", Seq.empty, /* default imports should be added here */ Seq( Binding("context", "_root_.org.scalatra.scalate.ScalatraRenderContext", importMembers = true, isImplicit = true) ), /* add extra bindings here */ Some("templates") ) ) } ) ++ seq(com.typesafe.startscript.StartScriptPlugin.startScriptForClassesSettings: _*) ) } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload