Hello,

Read 
http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Object_Fields_and_Entity_Properties

one possibility that 1 see: a change of type / format that you made to
some prop of your object and you access old entities in the datastore
with the new code. This may generate such an exception if DS cannot
convert old format to new one.

didier

On Sep 30, 1:16 am, "hendrix.jason" <hendrix.ja...@gmail.com> wrote:
> What could this error mean:
>
> java.lang.ClassCastException:
> [Lcom.google.appengine.api.datastore.Key; cannot be cast to
> com.google.appengine.api.datastore.Key
>
> It's happening on the last line of this code:
>
> PersistenceManager pm2 = PMF.get().getPersistenceManager();
>                 Key k =
> KeyFactory.createKey(User.class.getSimpleName(),Long.parseLong(Key));
>                 User u = pm2.getObjectById(User.class, k);
>
>                 Long[] group_array = u.getGroups();
>                 Key[] group_keys = new Key[group_array.length];
>                 int c = 0;
>                 while(c < group_array.length){
>                         group_keys[c] = 
> KeyFactory.createKey(Group.class.getSimpleName(),
> group_array[c]);
>                         c++;
>                 }
>
>                 javax.jdo.Query q = 
> pm2.newQuery(Group.class,"key.contains(:key)");
>                 List<Group> groups = (List<Group>) q.execute(group_keys);

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to