> <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <module> > <inherits name='com.google.gwt.user.User'/> > <inherits name="com.gwtext.GwtExt"/> > <entry-point class='my.server.Myclass'/> > </module>
First, you don't have a <source> tag, so you're just getting a source path of "client" by default. That would include anything in the my.server.client package but would not include my.server.MyClass. Second, you're declaring my.server.Myclass as an entry point. I can't imagine why you'd actually have an EntryPoint in your server package, so I'm going to assume this is a mistake and recommend removing that line. Third, I think you're going to be better off creating a third package called "common" or "shared" or some such and putting your shared client/server code there. Having references to "server" packages in your client code should be a giant red flag. On Wed, Feb 18, 2009 at 11:30 AM, Eros <eros.zanche...@gmail.com> wrote: > > Hi everybody, > > I know this is probably a very stupid question but please bear with > me. > > I'm trying to use the same class on server and client (so I don't have > to duplicate code): is it at all possible? Apparently it is, but for > the life of me I can't figure out how to do it, I did the following, > in file Client.java > > package my.client; > import my.server.Myclass; > > In file Client.gwt.xml I added: > > <inherit name="my.server.myclass" /> > > At this point the compiler complained about a missing .gwt.xml file, > so I added a file Myclass.gwt.xml to the my.server directory, the file > looks like this: > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <module> > <inherits name='com.google.gwt.user.User'/> > <inherits name="com.gwtext.GwtExt"/> > <entry-point class='my.server.Myclass'/> > </module> > > but I still get this error: > > No source code is available for type my.server.Myclass; did you forget > to inherit a required module? > > Any pointers will be very much appreciated. > > Cheers, > Eros > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---