I'm going to reply to my own question after working out a solution. I found that Guice needs all classes to be in the war classpath i.e. all classes from other projects must be in jars or in war/WEB-INF/ classes
My solution was to create a build.xml in my Core project whose job is to jar up the Core classes and then copy the jar into war/WEB-INF/lib of the GWT project. I then added this ant build as a new "builder" for the Core project so that it is automatically run any time I make changes to Core. One of the builder types is an ant builder. I'm happy to hear from anyone else about better solutions but this one worked for me. On Jul 3, 12:05 pm, stevebuikhuizen <[email protected]> wrote: > I am setting up guice with my GWT application. I have separate > projects for each modular component of the application. > > All projects import my "Core" project in their build paths so that > they can see the interfaces which abstract away all the other projects > and then use modules to make them real for tests etc. This is my > understanding of the core benefit of guice. > > When I then create a GWT project I need import the "Core" project > again to see the interfaces - this works fine for compilation. However > when I run the webapp I get a NoClassDefFoundError on one of the > interfaces in the "Core" project. > > This tells me that Guice cannot use the classpath that is provider by > the project build path and inherited by the Run Configuration for the > webapp. Is that correct? It seems like Guice needs all the classes to > be in the war/WEB-INF/classes folder for the GWT app and cannot see > those that are available on the classpath. > > If so, what is the right way to set up modular projects for one big > application? > > Any help is welcome and much appreciated! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" 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-guice?hl=en -~----------~----~----~----~------~----~------~--~---
