Hi,
I am trying to query my appengine data datastore on my laptop using
RemoteAPI. I am using JDO Query object to query the data. I have setup all
the required datanuclues setup on my local box. When I run the following
simple code I see the error. When I run the same Query on appengine as a
servlet it looks ok but when I run it on my localbox, i have this error. Any
thoughts?
INFO: Listener found initialisation for persistable class
com.neeli.data.EventTask
java.lang.ClassCastException: com.google.appengine.api.datastore.Blob cannot
be cast to java.util.HashMap
at com.neeli.data.EventTask.jdoReplaceField(EventTask.java)
at com.neeli.data.EventTask.jdoReplaceFields(EventTask.java)
import com.google.appengine.tools.remoteapi.RemoteApiInstaller;
import com.google.appengine.tools.remoteapi.RemoteApiOptions;
import com.neeli.data.EventTask;
import java.io.IOException;
import javax.jdo.Query;
import javax.jdo.PersistenceManager;
import java.util.List;
public class RemoteApiTest {
public static void main(String[] args) throws IOException {
RemoteApiOptions options = new RemoteApiOptions()
.server("myapp.appspot.com", 443)
.credentials(<username>, <password>);
RemoteApiInstaller installer = new RemoteApiInstaller();
installer.install(options);
try {
PersistenceManager pm = PMF.get().getPersistenceManager();
//DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Query query = pm.newQuery(EventTask.class);
List<EventTask> results = (List<EventTask>) query.execute();
if (!results.isEmpty()) {
for (EventTask task : results) {
System.out.println("taskId = " + task.getTaskId() + "; taskTitle = " +
task.getTitle());
}
} else {
System.out.println("No data");
}
} catch (Exception e) {
e.printStackTrace();
} finally {
installer.uninstall();
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine-java/-/MVNd9OxGQlMJ.
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-appengine-java?hl=en.