Re: java.lang.NoSuchMethodError: com.google.appengine.api.datastore.Key.getAppIdNamespace

415 views
Skip to first unread message

Vishesh Duggar

unread,
Jun 7, 2013, 6:29:48 AM6/7/13
to objectify...@googlegroups.com
I upgraded to RC1 which seems to be have caused this. But now it fails when I query using a simple filter
java.lang.NoSuchMethodError: com.googlecode.objectify.Objectify.factory()Lcom/googlecode/objectify/ObjectifyFactory;
	at com.googlecode.objectify.impl.QueryImpl.fact(QueryImpl.java:466)
	at com.googlecode.objectify.impl.QueryImpl.<init>(QueryImpl.java:79)
	at com.googlecode.objectify.impl.LoadTypeImpl.createQuery(LoadTypeImpl.java:48)
	at com.googlecode.objectify.impl.LoadTypeImpl.filter(LoadTypeImpl.java:56)

Thanks in advance.

On Thursday, June 6, 2013 2:37:40 PM UTC+5:30, Vishesh Duggar wrote:
Hi All,

When trying to save an object I get a weird NoSuchMethodError. This method does exist class Key and the code works find on the devserver but fails with this exception when deploying to appengine

com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchMethodError: com.google.appengine.api.datastore.Key.getAppIdNamespace()Lcom/google/appengine/api/datastore/AppIdNamespace;
	at com.google.appengine.api.datastore.KeyTranslator.convertToPb(KeyTranslator.java:49)
	at com.google.appengine.api.datastore.EntityTranslator.convertToPb(EntityTranslator.java:50)
	at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl.doBatchPutBySize(AsyncDatastoreServiceImpl.java:532)
	at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl.doIndexedEntityBatchPutBySize(AsyncDatastoreServiceImpl.java:629)
	at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl.put(AsyncDatastoreServiceImpl.java:464)
	at com.googlecode.objectify.cache.CachingAsyncDatastoreService.put(CachingAsyncDatastoreService.java:415)
	at com.googlecode.objectify.impl.WriteEngine.save(WriteEngine.java:79)
	at com.googlecode.objectify.impl.SaverImpl.entities(SaverImpl.java:60)
	at com.googlecode.objectify.impl.SaverImpl.entity(SaverImpl.java:35)
	at com.addicaid.controller.user.RegisterController.index(RegisterController.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:45)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
	at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59)
	at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:49)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	at com.google.appengine.tools.appstats.AppstatsFilter.doFilter(AppstatsFilter.java:141)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at com.addicaid.filter.NamespaceFilter.doFilter(NamespaceFilter.java:34)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
	at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
	at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
	at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
	at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
	at java.lang.Thread.run(Thread.java:722)

Vishesh Duggar

unread,
Jun 8, 2013, 1:14:58 AM6/8/13
to objectify...@googlegroups.com
Back to square one I am getting the same exception again.

noSuchMethodError: com.google.appengine.api.datastore.Key.getAppIdNamespace

 I am new to Objectify but it seems the Key implementations intentionally takes out AppIdNamespace but this breaks the app. Has anyone else come across this.

Thanks,
Vishesh

Jeff Schnitzer

unread,
Jun 9, 2013, 12:47:47 PM6/9/13
to objectify...@googlegroups.com
What are you using to build?

Objectify includes GWT-safe versions of the basic GAE collection classes. It only includes the .java files, which shouldn't affect anyone other than GWT users. How it is affecting your regular java compile I cannot fathom.

Jeff




--
You received this message because you are subscribed to the Google Groups "objectify-appengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appen...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pedro

unread,
Jun 25, 2013, 4:29:30 PM6/25/13
to objectify...@googlegroups.com, je...@infohazard.org
I am also finding this issue with the 4.0rc1. The 4.0b3 works however.

To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appengine+unsub...@googlegroups.com.

Farrell

unread,
Jul 12, 2013, 1:35:50 PM7/12/13
to objectify...@googlegroups.com
I'm new to objectify, but not to GAE.  I was getting this with objectify 4.0b3 and 4.0rc1.  In my case it was related to being on appengine 1.7.7.  An upgrade to 1.8.1 fixed it for me.
Reply all
Reply to author
Forward
0 new messages