[play-1.2.4] [gae-1.6.0_b1] [scala-0.9.1] Cannot run Play 1.2.4 on GAE 1.6

403 views
Skip to first unread message

Mats

unread,
Jan 11, 2012, 7:42:55 AM1/11/12
to play-framework
Hi!
I have previously used Play + GAE without problems.
I am now upgrading to play-1.2.4 and gae-1.6.0_b1.

To play it safe, I decided to NOT add any of my application code
yet. So I only have the results of the following:

- play install scala
- play new app --with scala
- play install gae-1.6.0_b1
- play install siena
- play install crudsiena-2.0.2

First problem I ran into was that the 'play gae:deploy' would tell me:
Invalid command: gae:deploy

I had my GAE_PATH set up and noticed that it would only work if I
added the GAE module to my application.conf:
module.gae=${play.path}/modules/gae-1.6.0_b1
I believe modules in application.conf are deprecated in play-1.2.4,
in favor of dependencies i dependencies.yml.
I also have such a dependency:
- play -> gae 1.6.0_b1

With this module dependency in my app conf I could upload to GAE.

When I try to access the applications "Hello World" page on appspot
I get the "Oops, an error occurred. This exception..." page.

Checking the logs on GAE I see:
I 2012-01-11 12:57:15.909 play.Logger info: Play! is running in Google
App Engine
I 2012-01-11 12:57:16.095 play.Logger info: Starting /base/data/home/
apps/s~spryvote/1.356021383962026334/WEB-INF/application
W 2012-01-11 12:57:16.095 play.Logger warn: No tmp folder will be used
(cannot create the tmp dir)
W 2012-01-11 12:57:16.096 play.Logger warn: Declaring modules in
application.conf is deprecated. Use dependencies.yml instead
(module.gae)
E 2012-01-11 12:57:16.096 play.Logger error: Module gae will not be
loaded because /base/data/home/apps/s~spryvote/1.356021383962026334/
WEB-INF/modules/gae-1.6.0_b1 does not ex
I 2012-01-11 12:57:16.097 play.Logger info: Module gae is available (/
base/data/home/apps/s~spryvote/1.356021383962026334/WEB-INF/
application/modules/gae-1.6.0_b1)
I 2012-01-11 12:57:16.097 play.Logger info: Module scala is available
(/base/data/home/apps/s~spryvote/1.356021383962026334/WEB-INF/
application/modules/scala-0.9.1)
E 2012-01-11 12:57:16.759 play.Logger niceThrowable: Error loading
plugin LoadingPluginInfo{name='play.scalasupport.ScalaPlugin',
index=0, url=jar:file:/base/data/home/apps/s~s
I 2012-01-11 12:57:17.543 play.Logger info: Application is precompiled
I 2012-01-11 12:57:18.900 play.Logger info: Application 'signup4' is
now started !
I 2012-01-11 12:57:18.900 play.Logger info: Forcing PROD mode because
deploying as a war file.
E 2012-01-11 12:57:22.622 play.Logger niceThrowable: @69391cj1p
Internal Server Error (500) Execution exception NullPointerException
occured : null play.exceptions.JavaExec
I 2012-01-11 12:57:23.192 This request caused a new process to be
started for your application, and thus caused your application code to
be loaded for the first time. This requ

I'm not sure on how to find out more details from the GAE logs.

I have previously been using Play 1.1.1 with GAE 1.4.0 and Scala 0.8
without problem.

I'm I missing something basic or is there an issue with combining
play-1.2.4, gae-1.6.0_b1 and scala-0.9.1?

/ Mats

Pascal Voitot Dev

unread,
Jan 12, 2012, 12:28:55 PM1/12/12
to play-fr...@googlegroups.com
Hi,

does it work locally at least?
first idea after reading fast: don't put any dep in application.conf, comment them all and put all your deps in dependencies.yml (gae, scala, gae)
Then delete your tmp directory to keep nothing from previous compiling.
Rebuild everything and retry.

regards
Pascal


/ Mats

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Manuel Bernhardt

unread,
Jan 12, 2012, 1:47:01 PM1/12/12
to play-fr...@googlegroups.com
Hi,

> E 2012-01-11 12:57:16.759 play.Logger niceThrowable: Error loading
> plugin LoadingPluginInfo{name='play.scalasupport.ScalaPlugin',
> index=0, url=jar:file:/base/data/home/apps/s~s

This seems to point to a problem with the play-scala plugin. AFAIK the
last official release of the plugin won't work with the latest
version(s) of Play. Try using a more recent build e.g. from here:

require:
- delving -> scala 0.9.1_20111028

repositories:
- delving-modules:
type: http
artifact:
"http://development.delving.org/dist/[module]-[revision].zip"
contains:
- delving -> *

Manuel

Pascal Voitot Dev

unread,
Jan 12, 2012, 2:24:39 PM1/12/12
to play-fr...@googlegroups.com
Do you know what was the problem and what changed in recent version to solve it?

Pascal

Mats

unread,
Jan 13, 2012, 9:44:25 AM1/13/12
to play-framework
Hi!

Thanks for your suggestions.

I'm afraid depending on scala 0.9.1_20111028 as Manuel suggested gave
exactly the same result.

I cannot get any combination of recent versions of Play, Scala and GAE
working.
I't works locally but not after uploading to GAE.

I've removed everything specific to my application so I believe it
should
be quite repeatable.
The only thing I've done (using Play 1.2.3) is:

play install scala-0.9.1
play new app --with scala
play install gae-1.6.0_b1

I then added dependencies:
- play -> scala 0.9.1
- play -> gae 1.6.0_b1

play dependencies --sync
play gae:deploy

I get:

play.Logger niceThrowable: Cannot load jar:file:/base/data/home/apps/
s~spryvote/1.356069334296527009/WEB-INF/lib/play-scala.jar!/
play.plugins
java.lang.NullPointerException
at play.scalasupport.ScalaPlugin.<init>(ScalaPlugin.scala:170)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at play.plugins.PluginCollection.loadPlugins(PluginCollection.java:
100)
at play.Play.init(Play.java:286)

Using Play 1.2.4 with GAE 1.6.0_b1, I cannot do the 'play gae:deploy'
at all, I get:
~
~ Packaging
~ ---------
Traceback (most recent call last):
File "/Applications/play/play", line 153, in <module>
status =
cmdloader.commands[play_command].execute(command=play_command,
app=play_app, args=remaining_args, env=play_env, cmdloader=cmdloader)
File "/Applications/play-1.2.4/modules/gae-1.6.0_b1/commands.py",
line 220, in execute
package_as_gae_war(app, env, war_path, None)
File "/Applications/play-1.2.4/modules/gae-1.6.0_b1/commands.py",
line 54, in package_as_gae_war
if isParentOf(app.path, war_path):
File "/Applications/play-1.2.4/framework/pym/play/utils.py", line
38, in isParentOf
relpath = os.path.relpath(path1, path2)
AttributeError: 'module' object has no attribute 'relpath'

Using Play 1.2.3 + gae-1.6.0_b1 + scala-0.9.1, as said, after
uploading to GAE,
and doing a page request for the "Your Scala application is ready!"
default page I get:

play.Logger niceThrowable: Cannot load jar:file:/base/data/home/apps/
s~spryvote/1.356067776970267044/WEB-INF/lib/play-scala.jar!/
play.plugins
java.lang.NullPointerException
at play.scalasupport.ScalaPlugin.<init>(ScalaPlugin.scala:166)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at play.plugins.PluginCollection.loadPlugins(PluginCollection.java:
100)
at play.Play.init(Play.java:286)
at play.server.ServletWrapper.contextInitialized(ServletWrapper.java:
74)
at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:
548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:
1250)
at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:
517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:
467)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:
202)
at
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:
171)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:
123)
at com.google.apphosting.runtime.JavaRuntime
$RequestRunnable.run(JavaRuntime.java:422)
at com.google.tracing.TraceContext
$TraceContextRunnable.runInContext(TraceContext.java:449)
at com.google.tracing.TraceContext$TraceContextRunnable
$1.run(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:
695)
at com.google.tracing.TraceContext
$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:
333)
at com.google.tracing.TraceContext
$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:
325)
at com.google.tracing.TraceContext
$TraceContextRunnable.run(TraceContext.java:453)
at com.google.apphosting.runtime.ThreadGroupPool
$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)

The same thing happens to me using:
Play 1.2.3 + gae-1.6.0_b1 + scala-0.9.1_20111028.

I should add that I removed a folder from the 0.9.1_20111028 module:
rm -rf modules/scala-0.9.1_20111028/tmp/

It seemed it wouldn't do any harm and the upload would fail if I kept
the folder:
com.google.appengine.tools.admin.HttpIoException: Error posting to
URL: https://appengine.google.com/api/appversion/deploy?app_id=spryvote&version=1&
400 Bad Request
Exceeded the limit of 1000 for allowable files per directory within
WEB-INF/application/modules/scala-0.9.1_20111028/tmp/classes/play/db/
anorm/

So, the most "recent" combination of Play+GAE+Scala that I can get
working are play-1.2.1, gae-1.4.0, scala-0.9.

This is also expressed in this blog post I found, now a few months
old:
http://d.hatena.ne.jp/k4200/20110807/1312737091

So, if anyone has a working Play+GAE+Scala that is more recent then
mine I would really appreciate feedback!

/ Mats

PS:
The thing I wrote in my initial post about having to add a module,
module.gae, to application.conf was my mistake.
A 'play dependencies --sync' instead of editing application.conf would
have fixed the problem.






Pascal Voitot Dev

unread,
Jan 13, 2012, 10:32:25 AM1/13/12
to play-fr...@googlegroups.com
I'll try to deploy a test app this weekend to see what happens!

Pascal

Mats

unread,
Jan 13, 2012, 10:36:51 AM1/13/12
to play-framework

Excellent!
Thanks in advance!
/ Mats

On 13 Jan, 16:32, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:

Mats

unread,
Jan 18, 2012, 9:16:55 AM1/18/12
to play-framework
Hi!

I tried the newly released gae-1.6.0 module with the same result.

I do

play new myApp --with scala-0.9.1

My conf/dependencies.yml says:

require:
- play
- play -> scala 0.9.1
- play -> gae 1.6.0

I do
play dependencies --sync
play gae:deploy

I have my 'war/WEB-INF/appengine-web.xml' set up

Nothing else. Just the bare minimum of a Play/Scala/GAE-app.

I have to add that I must use play-1.2.3 to gae:deploy as using
play-1.2.4
I will get the following upon 'play gae:deploy' :

~
~ Packaging
~ ---------
Traceback (most recent call last):
File "/Applications/play/play", line 153, in <module>
status =
cmdloader.commands[play_command].execute(command=play_command,
app=play_app, args=remaining_args, env=play_env, cmdloader=cmdloader)
File "/Applications/play-1.2.4/modules/gae-1.6.0/commands.py", line
222, in execute
package_as_gae_war(app, env, war_path, None)
File "/Applications/play-1.2.4/modules/gae-1.6.0/commands.py", line
54, in package_as_gae_war
if isParentOf(app.path, war_path):
File "/Applications/play-1.2.4/framework/pym/play/utils.py", line
38, in isParentOf
relpath = os.path.relpath(path1, path2)
AttributeError: 'module' object has no attribute 'relpath'

That happens regardless of if I involve Scala or not.

I'm on Mac OSX 10.5.8 (Leapord) but I think I remember having the same
problem
with Play 1.2.4 + GAE 1.6 on Lion, I'll try Lion again later.

/ Mats

Pascal Voitot Dev

unread,
Jan 18, 2012, 9:25:17 AM1/18/12
to play-fr...@googlegroups.com
Hi,

I haven't tried with scala yet as I haven't got a simple sample (I only have more complex projects)
Do you have a very simple project I could use?

thanks
Pascal

Mats

unread,
Jan 18, 2012, 10:13:28 AM1/18/12
to play-framework
Setting up my example is a matter of minutes as I do not add anything
to
the application other than what Play and GAE requires. So there's
nothing
more to my application than the out-of-the-box "Hello World"
Play/GAE/Scala-app.

I'm not doing anything else than creating a play app "--with scala".

So - create a NEW, fresh play project:

Using Play 1.2.4:

play install scala-0.9.1 (if not done already)
play install gae-1.6.0
play new myApp --with scala-0.9.1

conf/dependencies.yml should say:
require:
- play
- play -> scala 0.9.1
- play -> gae 1.6.0

play dependencies --sync

play run

Accessing localhost you will first get an error as
play new myApp --with scala-0.9.1
seem to generate a faulty "app/views/main.scala.html" referring
jquery-1.5.2.min.js instead of jquery-1.6.4.min.js.

After fixing app/views/main.scala.html everything works nice locally.

Then update war/WEB-INF/appengine-web.xml to match your GAE id

then, in my case, 'play gae:deploy' does not work with Play 1.2.4.
It works with play 1.2.3 but then the

NullPointerException at ScalaPlugin.scala:166

appears in the GAE logs.

So - that's all.
Really nice if you could look into this as, I noted earlier, the "most
modern"
Play/GAE/Scala combination I can get working is play-1.2.1/gae-1.4.0/
scala-0.9.

Cheers! / Mats

On 18 Jan, 15:25, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:

Pascal Voitot Dev

unread,
Jan 18, 2012, 10:16:22 AM1/18/12
to play-fr...@googlegroups.com
ok, i'll try that!

pascal

Mats

unread,
Jan 18, 2012, 6:05:03 PM1/18/12
to play-framework

Update:

'play gae:deploy' using Play 1.2.4 + gae-1.6.0 works on my iMac with
Lion.
It did not work on a MacBook Pro with Leopard where I get:
AttributeError: 'module' object has no attribute 'relpath'
as mentioned earlier in this conversation.

So, my problem with gae:deploy is due to Leopard or simply the config
of my MacBook Pro.

However - still same problem with Play 1.2.4 + scala-0.9.1 +
gae-1.0.6:

java.lang.NullPointerException
at play.scalasupport.ScalaPlugin.<init>(ScalaPlugin.scala:166)

Cheers! / Mats

On 18 Jan, 16:16, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:

Pascal Voitot Dev

unread,
Jan 19, 2012, 2:50:37 AM1/19/12
to play-fr...@googlegroups.com
I'll try on ubuntu so it will be easy to know if it's a Mac problem :)

Pascal

Message has been deleted
Message has been deleted

Pascal Voitot Dev

unread,
Jan 22, 2012, 9:23:39 AM1/22/12
to play-fr...@googlegroups.com
Hi,
I reproduced exactly your problems and could find a way around!

Indeed, there is a small bug play-scala plugin which tries to create a scala compiler and this generates an exception trying to manipulate files which is not authorized in GAE. Yet, apparently, this bug doesn't prevent the server from running but it hides the real exception!
Then if you correct this little bug, you encounter another NPE exception generated by the exception handler toHumanException in ScalaTemplate: this toHumanException doesn't manage our real exception correctly and itself generates a NPE (an exception manager generating an NPE is funny, isn't it :) ). This is the same exception as the one reported there: https://play.lighthouseapp.com/projects/74274/tickets/45

So I worked around this bug again and finally could see the real exception : it comes from @views.defaults.html.welcome(title) in your index.scala.html which tries to find CSS from docviewer module (manuel.css and wiki.css) which is not delivered in the GAE WAR so it can't "reverse route" them and it generates an exception.
Correcting this right now would require some work and docviewer is not meant to be delivered in a prod environment (it's mainly a dev module).

So, please just remove this line @views.defaults.html.welcome(title) from your index.scala.html and replace it by "WELCOME" just to test if it solves your problem.

regards
Pascal

On Thu, Jan 19, 2012 at 9:04 PM, Bendanpa <bend...@gmail.com> wrote:
"play gae:deploy" does not work on ubuntu 10.04, it gives "Invalid
command: gae:deploy" message

I am using play 1.2.4, gae-sdk 1.6, gae module 1.6.0. I did not use
scala module

On Jan 18, 11:50 pm, Pascal Voitot Dev <pascal.voitot....@gmail.com>

Mats

unread,
Jan 23, 2012, 5:34:55 PM1/23/12
to play-framework
Yes - you are right!

Obviously the code generated by 'play new app --with scala' is not
deployable to GAE
out of the box.
(It also generates the faulty reference to jquery-1.5.2.min.js).

I removed the generated example code and inserted my own code and it
works!

I thought I should get the simple out-of-the-box Scala example working
on GAE first,
before I added my application logic, but the simple turned out to be
the hard!

Now my app runs with:
play 1.2.4
scala 0.9.1
gae 1.6.0
siena 2.0.7

Thanks a lot Pascal for your time and help!

/ Mats


On 22 Jan, 15:23, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages