I'm using some CSS transforms that generates a NodeSeq with embedded
{S.?()} calls. This seems to fail when the ? method is called, see
stacktrace at the end.
It looks like the rendering is done outside the scope of S? Is this
intentional? I can workaround by forcing the evaluation of the {}
sections by adding this:
val errorMessages:List[NodeSeq] = errorMessages2.map{ns =>
Unparsed(ns.toString)}
but it doesn't feel right :-)
/Jeppe
java.lang.IllegalStateException: Attempted to use resource bundles
outside of an initialized S scope. S only usable when initialized,
such as during request processing. Did you call S.? from Boot?
at net.liftweb.http.S$class.resourceBundles(S.scala:902)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.S$.resourceBundles(S.scala:48)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.S$class.resourceBundles(S.scala:878)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.S$.resourceBundles(S.scala:48)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.S$class.$qmark(S.scala:928)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.S$.$qmark(S.scala:48)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.mapper.MappedEnumString._valueToDisplayString(MappedEnumString.scala:57)
~[bin/:2.4-M4]
at net.liftweb.mapper.MappedEnumString.toString(MappedEnumString.scala:58)
~[bin/:2.4-M4]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:189)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
~[scala-library-2.9.1.jar:na]
at scala.collection.immutable.List.foreach(List.scala:45)
~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$3.apply(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
~[scala-library-2.9.1.jar:na]
at scala.collection.immutable.List.foreach(List.scala:45)
~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:279)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$1.apply(HtmlParser.scala:215)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5Writer$$anonfun$write$1.apply(HtmlParser.scala:214)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at scala.collection.Iterator$class.foreach(Iterator.scala:660)
~[scala-library-2.9.1.jar:na]
at scala.collection.LinearSeqLike$$anon$1.foreach(LinearSeqLike.scala:50)
~[scala-library-2.9.1.jar:na]
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
~[scala-library-2.9.1.jar:na]
at scala.xml.NodeSeq.foreach(NodeSeq.scala:43) ~[scala-library-2.9.1.jar:na]
at net.liftweb.util.Html5Writer$class.write(HtmlParser.scala:214)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Html5$.write(HtmlParser.scala:30)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.Html5Properties$$anonfun$htmlWriter$2.apply(HtmlProperties.scala:335)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.Html5Properties$$anonfun$htmlWriter$2.apply(HtmlProperties.scala:335)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.NodeResponse$class.toResponse(LiftResponse.scala:571)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.XhtmlResponse.toResponse(LiftResponse.scala:635)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.XhtmlResponse.toResponse(LiftResponse.scala:635)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftServlet.sendResponse(LiftServlet.scala:673)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:309)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:132)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:131)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:344)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:363)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.Helpers$.logTime(Helpers.scala:34)
~[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:131)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftServlet.service(LiftServlet.scala:142)
~[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2$$anonfun$apply$mcV$sp$1.apply$mcV$sp(HTTPProvider.scala:71)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2$$anonfun$apply$mcV$sp$1.apply(HTTPProvider.scala:70)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2$$anonfun$apply$mcV$sp$1.apply(HTTPProvider.scala:70)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.URLRewriter$.doWith(Req.scala:1244)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2.apply$mcV$sp(HTTPProvider.scala:69)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2.apply(HTTPProvider.scala:69)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2.apply(HTTPProvider.scala:69)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.HTTPProvider$class.service(HTTPProvider.scala:65)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftFilter.service(LiftServlet.scala:757)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ServletFilterProvider.scala:67)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1$$anonfun$apply$mcV$sp$1.apply(ServletFilterProvider.scala:62)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1$$anonfun$apply$mcV$sp$1.apply(ServletFilterProvider.scala:62)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19.apply(Vars.scala:619)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16$$anonfun$apply$17$$anonfun$apply$18.apply(Vars.scala:618)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16$$anonfun$apply$17.apply(Vars.scala:617)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16.apply(Vars.scala:616)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:615)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:515)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1.apply(ServletFilterProvider.scala:61)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun$doFilter$1.apply(ServletFilterProvider.scala:61)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16$$anonfun$apply$17$$anonfun$apply$18$$anonfun$apply$19.apply(Vars.scala:619)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16$$anonfun$apply$17$$anonfun$apply$18.apply(Vars.scala:618)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16$$anonfun$apply$17.apply(Vars.scala:617)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$16.apply(Vars.scala:616)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:615)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.doFilter(ServletFilterProvider.scala:60)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:757)
[lift-webkit_2.9.1-2.4-M4.jar:2.4-M4]
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.ContextHandler.__handle(ContextHandler.java:765)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
[jetty-6.1.25.jar:6.1.25]
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
[jetty-util-6.1.25.jar:6.1.25]
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
Note this is new code so it may always have worked like this. I was
just a little surprised. I cannot easily extract an example atm, but
it does involve the stuff mentioned here:
http://groups.google.com/group/liftweb/browse_frm/thread/7d9ba4955b55d16/bd6bf945536a1ed0
I've briefly tried a repl session in 2.8.1 and 2.9.1 and they both
seem to lazily evaluate {} sections:
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server
VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def f = {println("in f"); "f"}
f: java.lang.String
scala> def g = <a>{f}</a>
g: scala.xml.Elem
scala> g
in f
res0: scala.xml.Elem = <a>f</a>
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server
VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala> def f = {println("in f"); "f"}
f: java.lang.String
scala> def g = <a>{f}</a>
g: scala.xml.Elem
scala> g
in f
res0: scala.xml.Elem = <a>f</a>
/Jeppe
So, I did a little digging and it seems it's a general problem, not
just with CSS transforms.
Otoh, it happens only in special cases and since I guess this hasn't
caused problems so far maybe it's not worth to pursue.
The problem is the toString call that is made on an expression in the
{} block. This happens outside the scope of S. So essentially I had
something like this:
class Foo {
override def toString = S.?("Hi foo")
}
Now, if my snippet returns this:
def render = <h2>{new Foo}</h2>
The NodeSeq contains a reference to a Foo object and will eventually
call toString on this object (outside the S context)
If I instead modify the snippet:
def render = <h2>{(new Foo).toString}</h2>
It seems the {} expressions are evaluated when touching the NodeSeq,
but the toString is not made until needed:
scala> class Foo {println("New foo");override def toString =
{println("toString"); "Foo"}}
defined class Foo
scala> def x = <a>{new Foo}</a>
x: scala.xml.Elem
scala> x.length
New foo
res27: Int = 1
scala> x
New foo
toString
res28: scala.xml.Elem = <a>Foo</a>
scala> def y = <a>{(new Foo).toString}</a>
y: scala.xml.Elem
scala> y.length
New foo
toString
res30: Int = 1
scala> y
New foo
toString
res31: scala.xml.Elem = <a>Foo</a>
/Jeppe
Unless I'm misinterpreting what you're writing, I don't see how this is different from normal programming where code-blocks which reference stuff are passed by reference to other contexts for execution. For example, if one references a lazy-loaded object (think JPA, which needs a transaction for loading the lazy-field) in a closure and the one executing the closure is not withing the same transaction, it'll blow up saying something like "org.hibernate.LazyInitializationException: could not initialize proxy - no Session". This typically happens in comet-actors where the NodeSeq=>NodeSeq is executed in a thread originating from a custom thread-pool and not the web-container's http-thread-pool.
I just think this is one of those issues one as a programmer must know about and be aware of. It's no framework's fault.
--
Andreas Joseph Krogh <and...@officenet.no> - mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
[...]
> Unless I'm misinterpreting what you're writing, I don't see how this is different from normal programming where code-blocks which reference stuff are passed by reference to other contexts for execution. For example, if one references a lazy-loaded object (think JPA, which needs a transaction for loading the lazy-field) in a closure and the one executing the closure is not withing the same transaction, it'll blow up saying something like "org.hibernate.LazyInitializationException: could not initialize proxy - no Session". This typically happens in comet-actors where the NodeSeq=>NodeSeq is executed in a thread originating from a custom thread-pool and not the web-container's http-thread-pool.
>
> I just think this is one of those issues one as a programmer must know about and be aware of. It's no framework's fault.
I don't think we disagree. I was just surprised that the final
transformation of NodeSeq=>OutputStream was happening outside the
scope of the S context that generated the NodeSeq to begin with, even
if in the same thread, request etc.
And if we can minimize the issues one as a programmer must know about
an be aware of, I think we're making the world a better place :-)
/Jeppe
I totally agree!
On Wed, Sep 14, 2011 at 1:25 PM, Andreas Joseph Krogh
<and...@officenet.no> wrote:
[...]
I don't think we disagree. I was just surprised that the final
> Unless I'm misinterpreting what you're writing, I don't see how this is different from normal programming where code-blocks which reference stuff are passed by reference to other contexts for execution. For example, if one references a lazy-loaded object (think JPA, which needs a transaction for loading the lazy-field) in a closure and the one executing the closure is not withing the same transaction, it'll blow up saying something like "org.hibernate.LazyInitializationException: could not initialize proxy - no Session". This typically happens in comet-actors where the NodeSeq=>NodeSeq is executed in a thread originating from a custom thread-pool and not the web-container's http-thread-pool.
>
> I just think this is one of those issues one as a programmer must know about and be aware of. It's no framework's fault.
transformation of NodeSeq=>OutputStream was happening outside the
scope of the S context that generated the NodeSeq to begin with, even
if in the same thread, request etc.
And if we can minimize the issues one as a programmer must know about
an be aware of, I think we're making the world a better place :-)
/Jeppe
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
I've added a low-priority ticket
https://www.assembla.com/spaces/liftweb/tickets/1113-xml-interpolation-in-nodeseq-does-not-have-access-to-the-s-context
/Jeppe
I have the code written... will check in later tonight