You're right that the problem is GWT won't be able to compile the files having xstream references. Remember GWT converts parts of your application from Java to JavaScript.
If you use the GWT standard packaging conventions then everything in the 'client' folder is restricted to the GWT JRE Emultation API. Stuff in the 'server' folder can include whatever because it's actually running in a JVM, so if your package or library is on the class path it's good. It seems like a big restriction, but the emulation api covers a lot of stuff and if you think about it you can't use things like java.io, or java.sql in javascript anyway (same goes for xstream). When you added the <source path="...."> in the gwt module file you basically were telling the gwt compiler to try to compile those files to javascript as well and it won't work. Your workaround options are to remove the references to xstream from those existing files, or create data transfer / view objects that can be compiled to javascript and used on the server side. It may sounds like a lot of work at first, but you want to make sure the data going across the wire is as small as possible, so data transfer / view objects are a good practice anyway. Plus if you weren't using GWT you'd be mapping these objects with xstream references to something else anyway. Btw, GWT handles the serialization for you, so if you added xstream for that you can definitely just drop it. JRE Emulation Reference: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=RefJreEmulation On Mar 17, 2:37 pm, erincarikan <[email protected]> wrote: > Excuse my illiteracy as a newbie if my question is too trivial. > > I am trying to build a gwt application, my application is going to be > an extension to an existing big project. In the existing project > there's a package which contains objects with serialization and > deserialization capabilities. Xstream is being used to accomplish that > and instead of creating same objects under my object, I'd like to > existing objects from external existing project. > > As far as I read in the forums, I need to add a module to the existing > project: > > <module> > <inherits name='com.google.gwt.user.User'/> > <source path="source-path/"/> > </module> > > And in the gwt module I need to reference the application as follows: > > <inherits name='com.cmt.ngp.common.gui.playlist'/> > > So this helped, gwt compiler is able to recognize the external class > references, unfortunately this leads another big problem for me, gwt > compiler is not able to recognize xstream references, and throwing > lots of errors. > > So I am wondering if it's possible to prevent this from happening, if > so how: > > Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
