Getting Play precompilation class enhancer working with Google Appengine class enhancer

94 views
Skip to first unread message

Ray Mauge

unread,
Mar 23, 2011, 9:21:35 AM3/23/11
to play-framework
I am trying to use JPA on Google AppEngine. I am aware of the JPA
limitations here but I need the scaling and other benefits of the GAE.

Environment
Play! 1.1.1
GAE-1.4 module.
Google Java Appengine SDK 1.4.2

I have updated the play.jar by removing the line
400:play.db.jpa.JPAPlugin

from play.plugins (So Play! does not try to process the JPA annotated
sources)

I have created a file in app/models/User.java
...

package models;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Query;

@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private String userId;
private String name;


public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
...

I use play war to generate the war file
And then I use the Datanucleus ant tool to enhance the User.java file
for use on GAE

When I then deploy the file using the GAE SDK I get the following
errors:

WARNING: failed
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext@13e15f7{/,/
home/rmauge/playapps/peerwear.war}: java.lang.NoClassDefFoundError:
javax/jdo/spi/Detachable
Mar 23, 2011 1:16:49 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: failed JettyContainerService$ApiProxyHandler@135b1f3:
java.lang.NoClassDefFoundError: javax/jdo/spi/Detachable
Mar 23, 2011 1:16:49 PM com.google.apphosting.utils.jetty.JettyLogger
warn
WARNING: Error starting handlers
java.lang.NoClassDefFoundError: javax/jdo/spi/Detachable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at
play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:
103)
at
play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:
392)
at play.Play.preCompile(Play.java:482)
at play.Play.init(Play.java:273)
at play.server.ServletWrapper.contextInitialized(ServletWrapper.java:
55)
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
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
130)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:
130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
50)
at
com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:
186)
at
com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:
149)
at
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:
219)
at com.google.appengine.tools.development.DevAppServerMain
$StartAction.apply(DevAppServerMain.java:164)
at com.google.appengine.tools.util.Parser
$ParseResult.applyArgs(Parser.java:48)
at
com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:
113)
at
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:
89)
Caused by: java.lang.ClassNotFoundException: javax.jdo.spi.Detachable
at java.lang.ClassLoader.findClass(ClassLoader.java:359)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at
play.classloading.ApplicationClassloader.loadClass(ApplicationClassloader.java:
84)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 26 more


Is there a way to exclude certain files from Play! precompilation or
another solution to this?

Thanks
Ray.

David Wursteisen

unread,
Mar 23, 2011, 9:36:46 AM3/23/11
to play-fr...@googlegroups.com
Why not use Siena ?
http://www.playframework.org/modules/siena


2011/3/23 Ray Mauge <rma...@gmail.com>

--
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.


Pascal Voitot Dev

unread,
Mar 23, 2011, 9:43:23 AM3/23/11
to play-fr...@googlegroups.com
Yes you are right, why not use Siena? ;) (Ok, I shut up, I'm one of the developer of siena ;) )
Nevertheless, anyone who wants to help testing the new v1.0.0 beta1 version with Play+GAE is welcome!

Regards
Pascal

Ray Mauge

unread,
Mar 25, 2011, 12:32:59 AM3/25/11
to play-framework
Thanks for the replies. I found the error to the original problem: I
had to include all the jars from <APPENGINESDK>/lib/tools/orm in my
play application lib.
Further more JPA enhancement using the Datanucleus ANT task does not
seem to work but JDO does.
I looked at Siena and the documentation was lacking so I am going to
try using JDO instead.

Thanks.
Ray.

On Mar 23, 9:43 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
> Yes you are right, why not use Siena? ;) (Ok, I shut up, I'm one of the
> developer of siena ;) )
> Nevertheless, anyone who wants to help testing the new v1.0.0 beta1 version
> with Play+GAE is welcome!
>
> Regards
> Pascal
>
> On Wed, Mar 23, 2011 at 2:36 PM, David Wursteisen <
>

Pascal Voitot Dev

unread,
Mar 25, 2011, 3:26:36 AM3/25/11
to play-fr...@googlegroups.com
On Fri, Mar 25, 2011 at 5:32 AM, Ray Mauge <rma...@gmail.com> wrote:
Thanks for the replies. I found the error to the original problem: I
had to include all the jars from <APPENGINESDK>/lib/tools/orm in my
play application lib.

yes classical error, I should have thought about it!
 
Further more JPA enhancement using the Datanucleus ANT task does not
seem to work but JDO does.
I looked at Siena and the documentation was lacking so I am going to
try using JDO instead.


I promise there will be more and more doc soon for Siena because there are many more APIs in Siena v1.0.0...
You can try JDO. Just keep an eye on other APIs because there are all much simpler and modern than JDO...

Have fun anyway with Play! ;)
 

sas

unread,
Mar 25, 2011, 4:15:36 PM3/25/11
to play-framework
yeap, I suggest you give siena another try...

On 25 mar, 04:26, Pascal Voitot Dev <pascal.voitot....@gmail.com>
Reply all
Reply to author
Forward
0 new messages