Hi Keith, Thanks for the reply again. I checked <runtime WAR>/WEB-INF/lib and it did have FooShared.jar within it. I also unzipped the jar and was able to find GreetingService.class within it. Now I am not quiet sure whats that I am missing at this point.
May be I could try running your project locally, but I am still wondering what could be the problem given that everything seems to be in place. -aish On Apr 5, 12:56 pm, Keith Platfoot <kplatf...@google.com> wrote: > Hi aish, > > 1. Ah, it looks like I was mistaken: it is correct that you are not seeing > the com/foo/server folder in your runtime WAR directory's WEB-INF/classes > directory. Eclipse does not actually push class files from dependent > projects into WEB-INF/classes, but rather, creates a jar and pushes that to > WEB-INF/lib. So, check <runtime WAR>/WEB-INF/lib for FooShared.jar, which > should contain the compiled classes from FooShared. If the jar is missing, > or does not have the expected class files, then something is probably wrong > with the configuration of your FooShared project. > > 2. Your WEB-INF folder inside FooServer is correct. The WAR folder inside > your project (WebContent by default) should only contain input files and > resources: HTML, JSP, CSS, etc.). Eclipse will take care of populating the > WEB-INF/lib and WEB-INF/classes of your runtime WAR directory (or exported > WAR file) automatically, based on your Java EE module dependencies. No need > to create an ant task to do so manually. > > I can zip up my Foo* projects and upload them here, if it would help get you > going. > > Keith > > On Mon, Apr 5, 2010 at 12:34 PM, aish sundar <sunda...@gmail.com> wrote: > > Hey Keith, > > > I am seeing a couple of things off here. > > > 1. after I start Tomcat, I do not see "client" folder under the war > > directory "<WAR>/WEB-INF/classes/com/foo/". I just see the "server" > > folder there. Do you know how to get the client there? I have added > > FooShared as a Java EE module dependency of FooServer. The -war > > argument in the GWT launch config is set to <eclipse > > workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/ > > wtpwebapps/FooServer. > > > 2. Another thing I noticed is that the WEB-INF folder within FooServer > > does not have any 'classes' folder within it. All it has is > > (i) lib folder > > (ii) web.xml > > > As I said, I have added FooShared as a Java EE module dependency of > > FooServer. Should we create a build.xml for FooServer (or some other > > procedure) to copy all the client and shared classes manually into > > WebContent/WEB-INF of FooServer? > > > Thanks, > > Aishwarya > > > On Apr 2, 2:39 pm, Keith Platfoot <kplatf...@google.com> wrote: > > > Hi aish, > > > > After you start Tomcat, see if the runtime WAR directory (the one > > specified > > > with -war argument in your GWT launch configuration) has the > > > GreetingService.class file under <WAR>/WEB-INF/classes/com/foo/client. > > If > > > it's not there, that would explain the ClassNotFoundException. Then the > > > only question is how to get it there. > > > > Your configuration as you described it sounds correct. GreetingService > > > should be copied into FooServer's WEB-INF/classes by means of it being > > > declared an Java EE module dependency. FooServer also needs > > gwt-servlet.jar > > > as a module dependency, but if you were missing that you would get a > > > different error. > > > > If you can't make any headway getting things to work, I could probably > > zip > > > up my sample projects and you could try importing those. Just let me > > know. > > > > Keith > > > > On Wed, Mar 31, 2010 at 2:55 PM, aish sundar <sunda...@gmail.com> wrote: > > > > Thanks Keith. The steps seemed a lot clearer now and I followed it to > > > > set uo my workspace exactly as yours. Now when I start the Tomcat > > > > server, launch the client in DEV mode and go to > > > >http://localhost:8080/TestWeb, > > > > everything loads up fine and I get to the client HTML page alright. > > > > However when I click a button, which is tied to an Asynchronous RPC > > > > call, I get the following exception : > > > > > SEVERE: Allocate exception for servlet greetServlet > > > > java.lang.ClassNotFoundException: com.foo.client.GreetingService > > > > at java.net.URLClassLoader$1.run(Unknown Source) > > > > at java.security.AccessController.doPrivileged(Native Method) > > > > at java.net.URLClassLoader.findClass(Unknown Source) > > > > at java.lang.ClassLoader.loadClass(Unknown Source) > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > > > > at java.lang.ClassLoader.loadClass(Unknown Source) > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source) > > > > at java.lang.ClassLoader.defineClass1(Native Method) > > > > at java.lang.ClassLoader.defineClass(Unknown Source) > > > > at java.security.SecureClassLoader.defineClass(Unknown Source) > > > > at java.net.URLClassLoader.defineClass(Unknown Source) > > > > at java.net.URLClassLoader.access$000(Unknown Source) > > > > at java.net.URLClassLoader$1.run(Unknown Source) > > > > at java.security.AccessController.doPrivileged(Native Method) > > > > at java.net.URLClassLoader.findClass(Unknown Source) > > > > at java.lang.ClassLoader.loadClass(Unknown Source) > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > > > > at java.lang.ClassLoader.loadClass(Unknown Source) > > > > at > > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: > > > > 1275) > > > > at > > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: > > > > 1206) > > > > at > > > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java: > > > > 1083) > > > > at > > > > org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java: > > > > 806) > > > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: > > > > 129) > > > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: > > > > 175) > > > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: > > > > 128) > > > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: > > > > 102) > > > > at > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: > > > > 109) > > > > at > > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: > > > > 286) > > > > at > > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: > > > > 844) > > > > at org.apache.coyote.http11.Http11Protocol > > > > $Http11ConnectionHandler.process(Http11Protocol.java:583) > > > > at > > > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: > > > > 447) > > > > at java.lang.Thread.run(Unknown Source) > > > > > The synchronous version of the GreetingService is in com.foo.client > > > > package within the FooShared project(just as you have mentioned). I > > > > have also added FooShared as a proj dependancy of FooClient and a > > > > module dependency of FooServer. > > > > > NOTE: I did not do Step 15 in your instructions i.e., haven't really > > > > created a WAR file for deployment yet. Its all running locally. > > > > > The error message is not very helpful as well, in terms of when and > > > > where was the exception thrown. any idea what could have caused it. > > > > > Thanks, > > > > aish > > > > > On Mar 30, 1:51 pm, Keith Platfoot <kplatf...@google.com> wrote: > > > > > Hi aish, > > > > > > 1) Yes, FooServer would be your existing Dynamic Web project > > (TestWeb). > > > > > This project should include anything in the .server package of your > > GWT > > > > app > > > > > (e.g. GreetingServerImpl) as well as any existing server-side code. > > > > > > Your WAR directory (you'll have just one) will be the WebContent > > > > directory > > > > > of TestWeb. Dynamic Web projects are configured to use the > > configuration > > > > > and resource files (web.xml, HTML, CSS, JS, etc.) from this directory > > to > > > > > build your WAR when debugging locally or creating a .war file for > > > > > deployment. BTW, the default name is "WebContent", but this can be > > > > > customized during the New Dynamic Web project wizard. > > > > > > Your GWT code (in TestUI) will need to integrate into TestWeb's WAR > > > > > directory when you run/debug locally and when you build a .war file. > > For > > > > > running locally, you just need to tell GWT DevMode to run within the > > > > context > > > > > of TestWeb's staging WAR directory (see steps 11 and 12 in my > > checklist). > > > > > You don't need to copy any files manually, because GWT will pick up > > all > > > > the > > > > > .java and .gwt.xml source files it needs directly from the launch > > > > classpath. > > > > > So there really is no explicit link to TestWeb from TestUI. The > > only > > > > link > > > > > from TestWeb back to TestUI is that your HTML host page in TestWeb's > > > > > WebContent directory will need to reference your GWT module's > > bootstrap > > > > > script (the TestUI.nocache.js file, which GWT will automatically > > insert > > > > into > > > > > your staging WAR directory when you launch dev mode). > > > > > > Creating a .war for deployment, on the other hand, does require > > moving > > > > > compiled GWT output into TestWeb's WebContent directory. Select the > > > > TestUI > > > > > project and click the GWT Compile button on the toolbar. Expand the > > > > > Advanced section at the bottom and put "-war > > > > > /absolute/path/to/TestWeb/WebContent". When you click Compile, the > > > > > artifacts will be written to that location. Because of a minor bug > > (to > > > > be > > > > > fixed in GPE 1.4), though, you'll need to refresh your TestWeb > > project to > > > > > see the compiled output under WebContent. Now, you can go through > > the > > > > WAR > > > > > export wizard (File > Export > Web > WAR file) to create a deployment > > > > .war > > > > > file for TestWeb. > > > > > > 2) TestUI should contain all your GWT module files. It should also > > > > contain > > > > > all GWT code, except for code that is shared between the client and > > > > server > > > > > (in my setup, I placed these classes in FooShared). > > > > > > 3) Attached is a screenshot of my workspace, showing all 3 projects > > > > > described in my checklist. > > > > > > Hopefully this gets you up and running. Let me know if you have any > > > > other > > > > > questions! > > ... > > read more » -- 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-tool...@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.