I have the following interface and class in my client(simplified
version of my original)
package mypackage;
import java.io.Serializable;
import java.util.TreeSet;
public interface MyInterface extends Serializable {
public TreeSet<String> getNames();
}
-------------------------------------------------------------
package mypackage;
import java.util.TreeSet;
public class MyInterfaceImpl implements MyInterface{
NameComparator c = new NameComparator();
private TreeSet<String> names = new TreeSet<String>(c);
public TreeSet<String> getNames() {
return names;
}
public void addName(String n){
names.add(n);
}
}
----------------------------------------------------------------
NameComparator is my custom comparator which is in the same package,
this is very simple comparator, compares 2 strings for their value.
In the server side I construct the MyInterfaceImpl and call addName to
add the
name the TreeSet. When I try to compile the gwt, I get a compile error
******************
[java] ERROR] Type
'com.ptc.windchill.option.choicecomponent.client.info.MyInterface' was
not serializable
and has no concrete serializable subtypes
******************
however when I change the method getNames to return Set
public Set<String> getNames(); and change the implementation like
below
----------------------------------------------------------------
package mypackage;
import java.util.TreeSet;
public class MyInterfaceImpl implements MyInterface{
NameComparator c = new NameComparator();
private Set<String> names = new TreeSet<String>(c);
public Set<String> getNames() {
return names;
}
public void addName(String n){
names.add(n);
}
}
----------------------------------------------------------------
I don't get compile error, but I get a run time error RPC serializaion
error
which says java.util.TreeSet is not a serializable object, the .rpc
file
does not have java.util.TreeSet
I have installed 1.5.3 version of gwt.
I have been struggling with this issue for couple of days, any help is
greatly appreciated.
Thanks
Venkee
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---