Lifty/lifty — Issue #8: TemplateException creating project
Author: jarhart
Created: 2011-11-25 20:04:20+00:00
State: open

I'm getting this exception running "lifty create lift project" with Lifty 1.7.3 on OS X Lion. Works like a charm on Ubuntu 11.10.

```
Rendering: helloworld.ssp
/var/folders/y9/tprkfvts2yv5663lj724ncyc0000gn/T/scalate-2002419531112176545-workdir/src/var/folders/y9/tprkfvts2yv5663lj724ncyc0000gn/T/lifty172646639817593331.ssp.scala:2: error: identifier expected but 'var' found.
package var.folders.y9.tprkfvts2yv5663lj724ncyc0000gn.T
^
one error found
[error] org.fusesource.scalate.TemplateException
[error] Use 'last' for the full log.
> last
org.fusesource.scalate.TemplateException
at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:834)
at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:691)
at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:411)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:405)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:451)
at org.lifty.engine.Scalate$.org$lifty$engine$Scalate$$render(Scalate.scala:196)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(Scalate.scala:106)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(Scalate.scala:105)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9.apply(Scalate.scala:105)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9.apply(Scalate.scala:104)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8.apply(Scalate.scala:104)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8.apply(Scalate.scala:103)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1.apply(Scalate.scala:103)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1.apply(Scalate.scala:101)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$.processTemplateInMemory(Scalate.scala:101)
at org.lifty.engine.Scalate$.org$lifty$engine$Scalate$$processTemplate(Scalate.scala:91)
at org.lifty.engine.Scalate$$anonfun$run$1.apply(Scalate.scala:31)
at org.lifty.engine.Scalate$$anonfun$run$1.apply(Scalate.scala:29)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at org.lifty.engine.Scalate$.run(Scalate.scala:29)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15$$anonfun$apply$16.apply(Lifty.scala:93)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15$$anonfun$apply$16.apply(Lifty.scala:93)
at scalaz.Identity$$anon$1.value(Identity.scala:170)
at scalaz.Identity$class.success(Identity.scala:101)
at scalaz.Identity$$anon$1.success(Identity.scala:169)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15.apply(Lifty.scala:93)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15.apply(Lifty.scala:92)
at scalaz.Validation$class.flatMap(Validation.scala:22)
at scalaz.Success.flatMap(Validation.scala:82)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14.apply(Lifty.scala:92)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14.apply(Lifty.scala:90)
at scalaz.Validation$class.flatMap(Validation.scala:22)
at scalaz.Success.flatMap(Validation.scala:82)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13.apply(Lifty.scala:90)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13.apply(Lifty.scala:89)
at scalaz.Validation$class.flatMap(Validation.scala:22)
at scalaz.Success.flatMap(Validation.scala:82)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7.apply(Lifty.scala:89)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7.apply(Lifty.scala:88)
at scala.Option.map(Option.scala:133)
at org.lifty.engine.Lifty$class.org$lifty$engine$Lifty$$runCommand(Lifty.scala:88)
at org.lifty.engine.Lifty$$anonfun$run$2.apply(Lifty.scala:34)
at org.lifty.engine.Lifty$$anonfun$run$2.apply(Lifty.scala:32)
at scala.Option.map(Option.scala:133)
at org.lifty.engine.Lifty$class.run(Lifty.scala:32)
at org.lifty.engine.LiftyInstance.run(Lifty.scala:165)
at org.lifty.Lifty$$anonfun$liftyCommand$1.apply(Lifty.scala:94)
at org.lifty.Lifty$$anonfun$liftyCommand$1.apply(Lifty.scala:18)
at sbt.Command$$anonfun$sbt$Command$$apply1$1$$anonfun$apply$6.apply(Command.scala:74)
at sbt.Command$.process(Command.scala:92)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:121)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:121)
at sbt.State$$anon$1.process(State.scala:154)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:121)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:121)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(Main.scala:121)
at sbt.MainLoop$.run(Main.scala:114)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(Main.scala:103)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(Main.scala:100)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(Main.scala:100)
at sbt.MainLoop$.runAndClearLast(Main.scala:83)
at sbt.MainLoop$.runLoggedLoop(Main.scala:67)
at sbt.MainLoop$.runLogged(Main.scala:60)
at sbt.xMain.run(Main.scala:33)
at xsbt.boot.Launch$.run(Launch.scala:54)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:25)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: Plain compile failed
at sbt.compiler.RawCompiler.checkForFailure(RawCompiler.scala:34)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:27)
at org.lifty.Lifty$$anonfun$liftyCommand$1$SBTCompiler$1.compile(Lifty.scala:74)
at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:750)
at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:691)
at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:411)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:405)
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:451)
at org.lifty.engine.Scalate$.org$lifty$engine$Scalate$$render(Scalate.scala:196)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(Scalate.scala:106)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(Scalate.scala:105)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9.apply(Scalate.scala:105)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8$$anonfun$apply$9.apply(Scalate.scala:104)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8.apply(Scalate.scala:104)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1$$anonfun$apply$8.apply(Scalate.scala:103)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1.apply(Scalate.scala:103)
at org.lifty.engine.Scalate$$anonfun$processTemplateInMemory$1.apply(Scalate.scala:101)
at scala.Option.flatMap(Option.scala:146)
at org.lifty.engine.Scalate$.processTemplateInMemory(Scalate.scala:101)
at org.lifty.engine.Scalate$.org$lifty$engine$Scalate$$processTemplate(Scalate.scala:91)
at org.lifty.engine.Scalate$$anonfun$run$1.apply(Scalate.scala:31)
at org.lifty.engine.Scalate$$anonfun$run$1.apply(Scalate.scala:29)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at org.lifty.engine.Scalate$.run(Scalate.scala:29)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15$$anonfun$apply$16.apply(Lifty.scala:93)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15$$anonfun$apply$16.apply(Lifty.scala:93)
at scalaz.Identity$$anon$1.value(Identity.scala:170)
at scalaz.Identity$class.success(Identity.scala:101)
at scalaz.Identity$$anon$1.success(Identity.scala:169)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15.apply(Lifty.scala:93)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14$$anonfun$apply$15.apply(Lifty.scala:92)
at scalaz.Validation$class.flatMap(Validation.scala:22)
at scalaz.Success.flatMap(Validation.scala:82)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14.apply(Lifty.scala:92)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13$$anonfun$apply$14.apply(Lifty.scala:90)
at scalaz.Validation$class.flatMap(Validation.scala:22)
at scalaz.Success.flatMap(Validation.scala:82)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13.apply(Lifty.scala:90)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7$$anonfun$apply$13.apply(Lifty.scala:89)
at scalaz.Validation$class.flatMap(Validation.scala:22)
at scalaz.Success.flatMap(Validation.scala:82)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7.apply(Lifty.scala:89)
at org.lifty.engine.Lifty$$anonfun$org$lifty$engine$Lifty$$runCommand$7.apply(Lifty.scala:88)
at scala.Option.map(Option.scala:133)
at org.lifty.engine.Lifty$class.org$lifty$engine$Lifty$$runCommand(Lifty.scala:88)
at org.lifty.engine.Lifty$$anonfun$run$2.apply(Lifty.scala:34)
at org.lifty.engine.Lifty$$anonfun$run$2.apply(Lifty.scala:32)
at scala.Option.map(Option.scala:133)
at org.lifty.engine.Lifty$class.run(Lifty.scala:32)
at org.lifty.engine.LiftyInstance.run(Lifty.scala:165)
at org.lifty.Lifty$$anonfun$liftyCommand$1.apply(Lifty.scala:94)
at org.lifty.Lifty$$anonfun$liftyCommand$1.apply(Lifty.scala:18)
at sbt.Command$$anonfun$sbt$Command$$apply1$1$$anonfun$apply$6.apply(Command.scala:74)
at sbt.Command$.process(Command.scala:92)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:121)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:121)
at sbt.State$$anon$1.process(State.scala:154)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:121)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:121)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(Main.scala:121)
at sbt.MainLoop$.run(Main.scala:114)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(Main.scala:103)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(Main.scala:100)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(Main.scala:100)
at sbt.MainLoop$.runAndClearLast(Main.scala:83)
at sbt.MainLoop$.runLoggedLoop(Main.scala:67)
at sbt.MainLoop$.runLogged(Main.scala:60)
at sbt.xMain.run(Main.scala:33)
at xsbt.boot.Launch$.run(Launch.scala:54)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:25)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
```

This is what lifty172646639817593331.ssp.scala looks like:

```scala
/* NOTE this file is autogenerated by Scalate : see http://scalate.fusesource.org/ */
package var.folders.y9.tprkfvts2yv5663lj724ncyc0000gn.T

import _root_.scala.collection.JavaConversions._
import _root_.org.fusesource.scalate.support.TemplateConversions._
import _root_.org.fusesource.scalate.util.Measurements._

object $_scalate_$lifty9031635718011334070_ssp {
def $_scalate_$render($_scalate_$_context: _root_.org.fusesource.scalate.RenderContext): Unit = {
;{
val context: _root_.org.fusesource.scalate.RenderContext = $_scalate_$_context.attribute("context")
import context._

;{
val mainpack: String = $_scalate_$_context.attribute("mainpack")
$_scalate_$_context << ( "\npackage " );
$_scalate_$_context <<< ( mainpack
);
$_scalate_$_context << ( " {\npackage snippet {\n\nimport scala.xml.{NodeSeq, Text}\nimport net.liftweb._\nimport util._\nimport common._\nimport java.util.Date\nimport " );
$_scalate_$_context <<< ( mainpack
);
$_scalate_$_context << ( ".lib._\nimport Helpers._\n\nclass HelloWorld {\n lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject the date\n\n def howdy(in: NodeSeq): NodeSeq =\n Helpers.bind(\"b\", in, \"time\" -> date.map(d => Text(d.toString)))\n\n /*\n lazy val date: Date = DependencyFactory.time.vend // create the date via factory\n\n def howdy(in: NodeSeq): NodeSeq = Helpers.bind(\"b\", in, \"time\" -> date.toString)\n */\n}\n\n}\n}" );
}
}
}
}

class $_scalate_$lifty9031635718011334070_ssp extends _root_.org.fusesource.scalate.Template {
def render(context: _root_.org.fusesource.scalate.RenderContext): Unit = $_scalate_$lifty9031635718011334070_ssp.$_scalate_$render(context)
}
```