asolfre / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
0 stars 0 forks source link

Problems with GWT + Objectify 4 while registering the entity #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am getting following errors at runtime while launching GWT 2.5 application 
using Objectify v4 on App Engine 1.7.5
The errors are generated while registering the Entity class.
I am using following imports for annotation  as suggested by objectify 4
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Id;
import com.googlecode.objectify.annotation.Ignore;

The Registering happens properly if I import the following
Import javax.persistence.Id

com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@1412b61{/,/base/
data/home/apps/s~ /1.365459642208582827}
java.lang.IllegalStateException: There must be an @Id field (String, Long, or 
long) for com.fleetor.shared.Place
    at com.googlecode.objectify.impl.ConcreteEntityMetadata.<init>(ConcreteEntityMetadata.java:79)
    at com.googlecode.objectify.impl.Registrar.register(Registrar.java:69)
    at com.googlecode.objectify.ObjectifyFactory.register(ObjectifyFactory.java:209)
    at com.googlecode.objectify.ObjectifyService.register(ObjectifyService.java:38)
    at com.fleetor.server.ObjectifyContextListener.contextInitialized(ObjectifyContextListener.java:31)
    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:219)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
1.      at 
com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:4
47)
2.      at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.j
ava:454)
3.      at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461
)
4.      at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
5.      at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xtNoUnref(TraceContext.java:338)
6.      at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xt(TraceContext.java:330)
7.      at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
8.      at 
com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java
:251)
9.      at java.lang.Thread.run(Thread.java:679)
10. 
11. C2013-02-21 02:43:05.958
12. Uncaught exception from servlet
13. javax.servlet.UnavailableException: Initialization failed.
14.     at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersio
nHandlerMap.java:228)
15.     at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHa
ndlerMap.java:194)
16.     at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(Jet
tyServletEngineAdapter.java:134)
17.     at 
com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:4
47)
18.     at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.j
ava:454)
19.     at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461
)
20.     at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
21.     at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xtNoUnref(TraceContext.java:338)
22.     at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedConte
xt(TraceContext.java:330)
23.     at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
24.     at 
com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java
:251)
    at java.lang.Thread.run(Thread.java:679)

Original issue reported on code.google.com by venkat.j...@gmail.com on 21 Feb 2013 at 12:06

GoogleCodeExporter commented 9 years ago
Are you sure that you don't have an Objectify3 jar on your path?  Ofy4 has no 
reference to javax.persistence.Id - it isn't even compiled with it.  If you 
need javax.persistence.Id, you have an old version of Objectify.

Original comment by lhori...@gmail.com on 21 Feb 2013 at 4:03

GoogleCodeExporter commented 9 years ago
Thanks for the response.. i have no idea where the objectify3 path was 
configured. I created a fresh project and it worked fine!

Original comment by venkat.j...@gmail.com on 21 Feb 2013 at 5:20

GoogleCodeExporter commented 9 years ago

Original comment by lhori...@gmail.com on 29 Mar 2013 at 7:57