Everybody seems to be missing this since app engine for java was released. Try reading the GWT Developer Guide guys, you'll find all kinds of interesting and useful stuff.
Anyway, the problem is that you can't use any org.datanucleus.store.appengine.* classes in your client-side code. You have to use the DTO pattern. Here's one of the discussions related to this topic from a couple of days ago: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/9365c6262baafe36 You could also try searching the forum, that'd keep us from answering the same question for the n-th time. Hope that helps; Salvador PS: The relevant part of the developer documentation discussing this is here: http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideClientSide On May 6, 11:01 am, Paul Robinson <[email protected]> wrote: > Your onFailure method ignores the Throwable it's given. Maybe it > contains something useful? > > Ouaibou wrote: > > Hello, > > > I have a problem with the callback of a RPC call. I have post in > > appengine forum because i think it was a problem with the appengine > > datastore, but Max Ross suggests me to post here : > > >http://groups.google.com/group/google-appengine-java/browse_thread/th... > > > In order to summarize : > > > I have two classes AudioFile and Genre. AudioFile as a field of type > > Genre. Both are marked as detachable like Max says me. I add an > > AudioFile in the datastore and then i do a RPC call in the client side > > in order to retrieve the data : > > > this.gtunesService.getAudioFiles(new AsyncCallback<List<AudioFile>>() > > { > > public void onFailure(Throwable caught) { > > SC.say(Gtunes.SERVER_ERROR); > > } > > public void onSuccess(List<AudioFile> result) > > { > > Gtunes.this.audioFiles = result; > > String buf = ""; > > for (AudioFile af : > > Gtunes.this.audioFiles) { > > buf += "genre = " + af.getGenre > > ().getName() + " - " > > + af.getName() > > + "<br />"; > > } > > SC.say(buf); > > } > > }); > > > The problem is in the server side with the following code : > > > public List<AudioFile> getAudioFiles() { > > List<AudioFile> audioFiles = null; > > PersistenceManager pm = PMF.get().getPersistenceManager(); > > > try { > > Query q = pm.newQuery(AudioFile.class); > > q.setOrdering("name"); > > audioFiles = new ArrayList<AudioFile>((List<AudioFile>) > > q.execute > > ()); > > pm.detachCopyAll(audioFiles); > > } finally { > > pm.close(); > > } > > > System.out.println("list = " + audioFiles); > > for (AudioFile audioFile : audioFiles) { > > System.out.println("name = " + audioFile.getName() + > > "\n"); > > } > > > return audioFiles; > > } > > > audioFiles contains my data. But the return has a problem because i > > enter in the onFailure in the client side but without any error. > > > However, i see that if i change the line : > > > audioFiles = new ArrayList<AudioFile>((List<AudioFile>) q.execute()); > > > for : > > > audioFiles = (List<AudioFile>) q.execute(); > > > I have get the following error : > > > 5 mai 2009 22:23:23 > > com.google.appengine.tools.development.ApiProxyLocalImpl log > > SEVERE: [1241555003875000] javax.servlet.ServletContext log: > > Exception > > while dispatching incoming RPC call > > com.google.gwt.user.client.rpc.SerializationException: Type > > 'org.datanucleus.store.appengine.query.StreamingQueryResult' was not > > included in the set of types which can be serialized by this > > SerializationPolicy or its Class object could not be loaded. For > > security purposes, this type will not be serialized. > > at > > com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSer > > ialize > > (StandardSerializationPolicy.java:83) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali > > ze > > (ServerSerializationStreamWriter.java:591) > > at > > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write > > Object > > (AbstractSerializationStreamWriter.java:129) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter > > $ValueWriter$8.write(ServerSerializationStreamWriter.java:146) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali > > zeValue > > (ServerSerializationStreamWriter.java:530) > > at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java: > > 573) > > at > > com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess > > (RPC.java:441) > > at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse > > (RPC.java:529) > > at > > com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall > > (RemoteServiceServlet.java:166) > > at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost > > (RemoteServiceServlet.java:86) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java: > > 713) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java: > > 806) > > at org.mortbay.jetty.servlet.ServletHolder.handle > > (ServletHolder.java: > > 487) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter > > (ServletHandler.java:1093) > > at > > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter > > (TransactionCleanupFilter.java:43) > > at org.mortbay.jetty.servlet.ServletHandler > > $CachedChain.doFilter > > (ServletHandler.java:1084) > > at org.mortbay.jetty.servlet.ServletHandler.handle > > (ServletHandler.java:360) > > at org.mortbay.jetty.security.SecurityHandler.handle > > (SecurityHandler.java:216) > > at org.mortbay.jetty.servlet.SessionHandler.handle > > (SessionHandler.java:181) > > at org.mortbay.jetty.handler.ContextHandler.handle > > (ContextHandler.java:712) > > at org.mortbay.jetty.webapp.WebAppContext.handle > > (WebAppContext.java: > > 405) > > at > > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle > > (DevAppEngineWebAppContext.java:54) > > at org.mortbay.jetty.handler.HandlerWrapper.handle > > (HandlerWrapper.java:139) > > at > > com.google.appengine.tools.development.JettyContainerService > > $ApiProxyHandler.handle(JettyContainerService.java:306) > > at org.mortbay.jetty.handler.HandlerWrapper.handle > > (HandlerWrapper.java:139) > > at org.mortbay.jetty.Server.handle(Server.java:313) > > at org.mortbay.jetty.HttpConnection.handleRequest > > (HttpConnection.java: > > 506) > > at org.mortbay.jetty.HttpConnection$RequestHandler.content > > (HttpConnection.java:844) > > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java: > > 644) > > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: > > 211) > > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: > > 381) > > at org.mortbay.io.nio.SelectChannelEndPoint.run > > (SelectChannelEndPoint.java:396) > > at org.mortbay.thread.BoundedThreadPool$PoolThread.run > > (BoundedThreadPool.java:442) > > > I don't know where to see in order to debug. Does someone has an > > idea ? > > > Thanks. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
