ninja-appengine icon indicating copy to clipboard operation
ninja-appengine copied to clipboard

Sample does not run with the dev server.

Open ludoch opened this issue 11 years ago • 9 comments

With ninja-appengine-demo mvn gae:run gives WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@3622e177{/,/Users/ludo/a/tmp/ninja-appengine/ninja-appengine-demo/target/ninja-appengine-demo-1.0.2-SNAPSHOT} java.lang.ClassCastException: com.google.appengine.tools.development.ApiProxyLocalImpl cannot be cast to com.google.appengine.tools.development.ApiProxyLocal at com.google.appengine.api.blobstore.dev.ServeBlobFilter.init(ServeBlobFilter.java:54) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

ludoch avatar Apr 06 '13 15:04 ludoch

On Sat, Apr 6, 2013 at 5:52 PM, ludoch [email protected] wrote:

With ninja-appengine-demo mvn gae:run gives WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@3622e17https://github.com/com.google.appengine.tools.development.DevAppEngineWebAppContext/ninja-appengine/commit/3622e177 {/,/Users/ludo/a/tmp/ninja-appengine/ninja-appengine-demo/target/ninja-appengine-demo-1.0.2-SNAPSHOT} java.lang.ClassCastException: com.google.appengine.tools.development.ApiProxyLocalImpl cannot be cast to com.google.appengine.tools.development.ApiProxyLocal at com.google.appengine.api.blobstore.dev.ServeBlobFilter.init(ServeBlobFilter.java:54) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)

— Reply to this email directly or view it on GitHubhttps://github.com/reyez/ninja-appengine/issues/1 .

Hi Ludoch,

thanks for having a look :) I am open to opinions here. The way the plugin works is not via the gae:run facilities, but via a simple jetty:run.

This also means I have to wire the gae proxy stuff (mailer, database admin console etc) myself. The advantage is that reloading works really fast and without any issues - among other things.

It is a bit modeled after the play-gae plugin https://github.com/guillaumebort/play-gae.

So - I did not play around with gae:run, but only used jetty:run.

But in theory gae:run should work fine...

Best,

Raphael

raphaelbauer avatar Apr 06 '13 17:04 raphaelbauer

ok, I need to find a clean solution...

ludoch avatar Apr 06 '13 20:04 ludoch

Hi Ludoch,

I was thinking about that. And actually I really like the idea of integrating the dev server in a clean way. I played around inside a branch (not really cleaned up). But you should be able to do a mvn appengine:devserver... All stuff like _ah/admin and so on is accessible as well. See https://github.com/reyez/ninja-appengine/tree/feature-full-gae-devserver-support (be aware that the testcases do not run => compile with mvn install -DskipTests).

Two things were you maybe can help me:

  1. How can I make reloads of the devserver seamless (were should I compile my stuff => what files must I touch to trigger reloads). This does not work right now... Actually I would like to make it work like the jetty conf in the pom.xml of ninja-appengine-demo.
  2. I have to make up my mind how to implement best a testserver (aka NinjaTest). These tests are pretty powerful, but I have to make sure that a ApiProxy for the LocalDevEnvironment is there... Not sure how to deal with that best... But does not seem to be too complicated...

Would be great getting some feedback!

Thanks!

Raphael

raphaelbauer avatar Apr 06 '13 22:04 raphaelbauer

Okay I fixed everything... Please have a look at: https://github.com/reyez/ninja-appengine/tree/feature-full-gae-devserver-support

Feedback really appreciated. Reloading is done by touching appengine-web.xml automatically.

But one more thing: When reloading the devserver that way I am getting permgempspace out of memory errors really quickly... I added 512m already to the maven options by default. Do you know any remedy?

Thanks for your feedback!

raphaelbauer avatar Apr 07 '13 00:04 raphaelbauer

Whao...It's gonna be very nice very quickly...We'll see what we can do on our side soon. It has to be as simple as Jetty...

ludoch avatar Apr 07 '13 00:04 ludoch

On Tue, Apr 9, 2013 at 10:38 AM, Samuel Liard [email protected]:

Just download your last link, but I can't launch "mvn gae:run" or "mvn appengine:devserver"

I miss something ?

— Reply to this email directly or view it on GitHubhttps://github.com/reyez/ninja-appengine/issues/1#issuecomment-16100682 .

The branch I created allows to use mvn appengine:devserver. But I have to do some cleaning...

Simply hit jetty:run (in branch develop or in released version) and go :)

ra

raphaelbauer avatar Apr 09 '13 09:04 raphaelbauer

Humm now seeing again the initial exception using a fresh refresh...

ludoch avatar Apr 23 '13 02:04 ludoch

On Tue, Apr 23, 2013 at 4:47 AM, ludoch [email protected] wrote:

Humm now seeing again the initial exception using a fresh refresh...

— Reply to this email directly or view it on GitHubhttps://github.com/reyez/ninja-appengine/issues/1#issuecomment-16836207 .

Hmm...

That can happen if something with the compilation and the mode goes wrong.

Try: mvn clean appengine:devserver -Pappengine-dev (recommended as with the official devserver)

or

mvn clean jetty:dev -Pjetty-dev

The important thing is the "clean". It should work then :)

Let me know if that helps!

Best,

Raphael

raphaelbauer avatar Apr 23 '13 08:04 raphaelbauer

I've run into this problem a few times lately, and I'm writing the current solution here to help me find it again:

mvn clean appengine:devserver -Pdevserver

mattjonesorg avatar Jun 04 '14 19:06 mattjonesorg