Hi, rjcarr! thanks for your answer.
the point is that on the server (and actually also on the client) that field should be read-only. i found the problem in http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/super/com/google/gwt/emul/java/util/Collections.java line 114: TODO: make the unmodifiable collections serializable so i think i will forget trying to use my server-side beans for client code. i will just translate the server-side results to client-only beans. it is just a lot of work (cpu-time) for nothing, but it would be the same to convert them to JSON for other frameworks. thanks Michael On Mar 8, 9:59 pm, rjcarr <[email protected]> wrote: > The problem is likely exactly what you describe here: "but the GWT > compiler does not find those subclasses." More specifically, those > classes aren't part of the gwt jre emulation, so that's why you're > having problems. > > For the unmodifiable list, I'd just suggest not sending your list > through that filter. If you need that functionality, you'll have to > create your own implementation. > > For the empty list, I'm not really understanding the point. Couldn't > you just return "new ArrayList()"? I know that ArrayList is emulated, > so it would work. > > On Mar 8, 7:06 am, mmoossen <[email protected]> wrote: > > > Dear all! > > > i want to serialize a bean that has a field of type java.util.List<T> > > but while serializing i get following error message: > > > com.google.gwt.user.client.rpc.SerializationException: Type > > 'java.util.Collections$UnmodifiableRandomAccessList' 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.: instance = [...] > > > i think the problem is that on the server i use > > Collections.unmodifiableList(..) or Collections.emptyList(..) to > > populate that field, but the GWT compiler does not find those > > subclasses. > > > any idea? > > > thanks in advance > > Michael -- 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.
