Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Installing Scalate into Play
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt Raible  
View profile  
 More options Aug 24 2011, 12:22 am
From: Matt Raible <mrai...@gmail.com>
Date: Tue, 23 Aug 2011 21:22:59 -0700 (PDT)
Local: Wed, Aug 24 2011 12:22 am
Subject: Installing Scalate into Play
Hello all,

I'm trying to integrate Scalate into Play and running into some
issues. I'm using the instructions at:

http://www.playframework.org/modules/scalate-0.7.2/home

In dependencies.yml, I have:

require:
    - play
    - play -> scala 0.9.1
    - play -> scalate 0.7.2

application.conf has:

scalate=ssp

jvm.memory=-Xmx256M

When I try to run the app (after creating views/Application/
index.ssp), I get the following error:

22:13:16,400 WARN  ~ Cannot introspect on class loader: (play) [class
DocViewerPlugin, class controllers.Application, class
controllers.Application$, class controllers.PlayDocumentation, class
helpers.CheatSheetHelper, class helpers.CheatSheetHelper$1, class
helpers.CheatSheetHelper$2, class helpers.CheatSheetHelper$3] of type
play.classloading.ApplicationClassloader
22:13:17,564 ERROR ~ Compilation failed:
/Users/mraible/dev/play-more/tmp/src/errors/500.scaml.scala:5: error:
not found: value models
import controllers._;import models._;import play.utils._
                            ^
My project doesn't have a "models" package, so I created one and
dropped a "User" object into it.

From app/models/User.scala:

package models

class User

This gets me a little further, but not much. Now I see the following
page in my browser (in raw HTML):

<link href="/public/stylesheets/500.css" rel="stylesheet" type="text/
css"/>
<div id="scalate-error">
<div class="header block">
  <h1>
    Template file extension missing. Cannot determine which template
processor to use.
  </h1>
  <p>
    org.fusesource.scalate.TemplateException: Template file extension
missing. Cannot determine which template processor to use.
  </p>
</div>
<div class="details block">
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.generator(TemplateEngine.scala:
657)</pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:
557)</pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.sc ala:
523)</pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:
255)</pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:249)</
pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:307)</
pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:
381)</pre>
  <pre class="stacktrace">at
org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:
427)</pre>
  <pre class="stacktrace">at play.mvc.scalate.Provider
$class.renderScalateTemplate(Provider.scala:101)</pre>
  <pre class="stacktrace">at play.mvc.scalate.Provider
$class.renderWithScalate(Provider.scala:29)</pre>
  <pre class="stacktrace">at
play.mvc.ScalateController.renderWithScalate(ScalateController.scala:
3)</pre>
  <pre class="stacktrace">at
play.mvc.ScalateController.render(ScalateController.scala:4)</pre>
  <pre class="stacktrace">at controllers.Application$.index(app/
controllers/Application.scala:7)</pre>
  <pre class="stacktrace">at
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java: -2)</
pre>
  <pre class="stacktrace">at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)</pre>
  <pre class="stacktrace">at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:
25)</pre>
  <pre class="stacktrace">at
java.lang.reflect.Method.invoke(Method.java:597)</pre>
  <pre class="stacktrace">at
play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)</
pre>
  <pre class="stacktrace">at
play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)</pre>
  <pre class="stacktrace">at
play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:492)</
pre>
  <pre class="stacktrace">at
play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)</
pre>
  <pre class="stacktrace">at
play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)</pre>
  <pre class="stacktrace">at play.server.PlayHandler
$NettyInvocation.execute(PlayHandler.java:237)</pre>
  <pre class="stacktrace">at play.Invoker$Invocation.run(Invoker.java:
265)</pre>
  <pre class="stacktrace">at play.server.PlayHandler
$NettyInvocation.run(PlayHandler.java:217)</pre>
  <pre class="stacktrace">at java.util.concurrent.Executors
$RunnableAdapter.call(Executors.java:441)</pre>
  <pre class="stacktrace">at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:303)</pre>
  <pre class="stacktrace">at
java.util.concurrent.FutureTask.run(FutureTask.java:138)</pre>
  <pre class="stacktrace">at
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)</
pre>
  <pre class="stacktrace">at
java.util.concurrent.ScheduledThreadPoolExecutor
$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)</pre>
  <pre class="stacktrace">at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)</pre>
  <pre class="stacktrace">at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)</pre>
  <pre class="stacktrace">at java.lang.Thread.run(Thread.java:680)</
pre>
</div>
</div>

Questions:

1. Why are model objects required to use Scalate with Play?
2. What does "Template file extension missing" mean?

Thanks,

Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Raible  
View profile  
 More options Aug 24 2011, 9:25 pm
From: Matt Raible <mrai...@gmail.com>
Date: Wed, 24 Aug 2011 18:25:29 -0700 (PDT)
Local: Wed, Aug 24 2011 9:25 pm
Subject: Re: Installing Scalate into Play
I've updated to Play 1.2.3 today and I still haven't solved this
issue. Digging through some docs, it looks like render(name) might be
causing this problem. Here's my Application.scala class:

package controllers

import play.mvc._

object Application extends ScalateController  {
   def index() = {
     val name = "Guest user"
     render(name)
   }

}

This renders the raw HTML I mentioned below.

Digging through some documentation, google queries and such, I found
renderWithScalate(name) and Template(name) might be a better choice.

The former renders the following:

The value for 'name' was not set
org.fusesource.scalate.NoValueSetException: The value for 'name' was
not set

at org.fusesource.scalate.RenderContext$$anonfun$attribute
$1.apply(RenderContext.scala:113)
at org.fusesource.scalate.RenderContext$$anonfun$attribute
$1.apply(RenderContext.scala:113)
at scala.Option.getOrElse(Option.scala:104)
at org.fusesource.scalate.RenderContext
$class.attribute(RenderContext.scala:113)
at
org.fusesource.scalate.DefaultRenderContext.attribute(DefaultRenderContext. scala:
29)
at Application.$_scalate_$index_ssp$.$_scalate_$render(index.ssp.scala:
16)
at Application.$_scalate_$index_ssp.render(index.ssp.scala:31)
at
org.fusesource.scalate.DefaultRenderContext.capture(DefaultRenderContext.sc ala:
85)
at
org.fusesource.scalate.layout.DefaultLayoutStrategy.layout(DefaultLayoutStr ategy.scala:
43)
at org.fusesource.scalate.TemplateEngine$$anonfun$layout$1.apply$mcV
$sp(TemplateEngine.scala:398)
at org.fusesource.scalate.TemplateEngine$$anonfun$layout
$1.apply(TemplateEngine.scala:390)
at org.fusesource.scalate.TemplateEngine$$anonfun$layout
$1.apply(TemplateEngine.scala:390)
at org.fusesource.scalate.RenderContext$.using(RenderContext.scala:45)
at org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:
390)
at org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:
382)
at org.fusesource.scalate.TemplateEngine.layout(TemplateEngine.scala:
427)
at play.mvc.scalate.Provider
$class.renderScalateTemplate(Provider.scala:101)

Using Template(name) results in:

Template not found
The template Guest user does not exist.

Thanks for any advice.

On Aug 23, 10:22 pm, Matt Raible <mrai...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sean  
View profile  
 More options Oct 23 2011, 12:48 am
From: Sean <freitag.s...@gmail.com>
Date: Sat, 22 Oct 2011 21:48:32 -0700 (PDT)
Local: Sun, Oct 23 2011 12:48 am
Subject: Re: Installing Scalate into Play
I dug into the source, and it appears that the code and documentation
are not consistent. If you provide a string as the first argument in
the Seq of args you provide, it will assume that is the template name.
I haven't figured out all of the internals, but my advice is to not
provide a string as the first argument until the source can be updated
and released.

On Aug 24, 8:25 pm, Matt Raible <mrai...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »