GWT is gonna look for serializable classes even outside the client package??? I double checked all my classes in the project and all of them meet the needs for serialization. I understand that i have to be as specific as possible with RPC but i don't wanna have a bunch of services on my project and hove to manually configure them, that's why i'm trying to make a generic service.
Thanks for the answer Paul. On 1 abr, 13:28, Paul Robinson <[email protected]> wrote: > Edu wrote: > > I was using IsSerializable Interface until i read an article on gwt > > home page saying that i could use the java.io.Serializable interface, > > since i was using a generic servlett dispatch all my incoming > > resquest, the java.io.Serializable was much easier to use, so i > > changed all my classes that needed serialization and after that my > > services stoped working. > > > Here's the piece of code i'm using: > > > //Method on the servlet > > public HashMap<String, Serializable> getValue(String serviceClass, > > HashMap<String, Serializable> params) > > throws DyadException { > > try { > > Class clazz = Class.forName(serviceClass); > > DyadService classInstance = > > (DyadService)clazz.newInstance(); > > > HashMap<String, Serializable> ret = > > classInstance.getValue(params); > > //it gets here, but after then return call > > nothing happens > > return ret; > > } catch (Exception e) { > > DyadException ex = new DyadException(); > > ex.setDetailedError(e.getMessage()); > > throw ex; > > } > > } > > I don't know what you're problem is, but your change from > IsSerializable to Serializable does have a side-effect. When GWT > compiles your code, it now has to look for all Serializable classes to > convert to javascript, in case they get used with your code (since your > API now uses Serializable). When using IsSerializable, this is less of a > problem because you will only make classes implement IsSerializable that > will really be transported to the client, but you're probably using all > sorts of Serializable classes that will never get sent to your client, > and GWT has to sort through all of them at compile time. > > It's generally better to nail your GWT RPC API down to specific classes > as much as possible. This means using ArrayList instead of List or > Collection etc for anything a GWT client accesses. > > Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
