On Wednesday, January 23, 2013 11:52:30 AM UTC+1, Jostein wrote: > > Hi > I have developed an application in dev mode in Eclipe for some time and > everything workes fine. Yesterday I tried to deploy to Tomcat, but the > application did not launch in the browser. > Then I tried the same with a basic Web Application Starter Project, > generated automatically when creating a new GWT project i Eclipse. The new > project consists of some basic functionality, RPC included. > > The deploying process goes like this (this is my understandig of how to do > it) > 1. Perform "GWT Compile Project" from the blue "g" dropdown in the toolbar > in Eclipse > 2. Use default settings in the "GWT compile" dialog. Press "Compile". > 3. After comiling I select the .war folder in the TestTomcat project in > Eclipse. > 4. Then rightclick -> Export -> Archive file -> Next > 5. Change the "To archive file" to > "D:\apache-tomcat-7.0.34\webapps\TestTomcat.war.zip" -> Finish > 6. Opens the D:\apache-tomcat-7.0.34\webapps folder and renames the > "TestTomcat.war.zip" to "TestTomcat.war" > 7. Then I restart Tomcat and now a new folder "TestTomcat" has been > created in the webapps folder > > I run my app in a browser with this url: > http://localhost/TestTomcat/TestTomcat/war/TestTomcat.html > > The application starts as expected, but when I press the "Send" button > that is sending a name to the server I get an error message > "An error occurred while attempting to contact the server. Please check > your network connection and try again." > > My JAVA_HOME=C:\Program Files\Java\jdk1.7.0_09 > > a) Why doesn't RPC work? >
The fact your host page is at "TestTomcat/TestTomcat/war/TestTomcat.html" should ring a bell. It should probably be at "TestTomcat/TestTomcat.html" instead, which means your *.war isn't packaged correctly. The WEB-INF/ folder should be at the root of the WAR, alongside the TestTomcat.html. > b) Is this the correct way to deploy GWT application in Tomcat? > Probably not. Any "correct" way in my book would involve a build script (Ant, Maven, Gradle, or even Make or a shell/batch script) to package the app. Dropping the WAR into Tomcat's webapps dir and restarting Tomcat is OK though; see http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html#Deployment_With_Tomcat (read through the whole tutorial, a GWT is no different, just that the javascript is generated from Java code by an additional build step) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/u-tkjeVHu54J. 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.
