GWT Development Mode - 404 Error

I am likely missing a configuration option or have a wrong value.

I started with GWT 2.0 and the Google Eclipse plugin in Eclipse 3.5.1 and generated the base "greeting" project.

Then I reorganized the source tree and created pom.xml files based on the GWT-maven-plugin documentation on Multi-Project Setup.

Then I ran "mvn clean install idea:idea" to generate the IPR files.

IDEA 9.0 loaded the project (upconverting the version), detects the GWT and web facets which I "Accept".  I set the path to the GWT directory to the installed gwt-2.0.0 directory.

I created an IntelliJ "GWT Configuration" to launch the application.  When I run the application, the GWT Development Mode dialog initializes.  I click the "Launch Default Browser" button and a browser window opens with:

HTTP ERROR: 404

NOT_FOUND

RequestURI=/MyApp.html
Powered by Jetty://





The MyApp.html and MyApp.css are in both the generated webapp-1.0-SNAPSHOT directory and .war file.  However, if I trim the URL in the browser from http://localhost:8888/MyApp.html?gwt.codesvr=10.27.1.11:9997 to the http://localhost:8888/ , I can navigate the files served up by the Jetty server.  The .html and .css files I can see in the webapp-1.0-SNAPSHOT directory and .war file are not shown.  So it makes sense that a 404 is returned.  But why are the files that are in the build directory and artifact not part of the server being executed from the IntelliJ Run?  What piece of magic configuration am I missing?  Thank you.

Fred
4 comments
Comment actions Permalink

Do you set "Target Web Facet" option in GWT Facet settings?

I am likely missing a configuration option or have a wrong value.

I started with GWT 2.0 and the Google Eclipse plugin in Eclipse 3.5.1 and generated the base "greeting" project.

Then I reorganized the source tree and created pom.xml files based on the GWT-maven-plugin documentation on http://mojo.codehaus.org/gwt-maven-plugin/user-guide/multiproject.html.

Then I ran "mvn clean install idea:idea" to generate the IPR files.

IDEA 9.0 loaded the project (upconverting the version), detects the GWT and web facets which I "Accept".  I set the path to the GWT directory to the installed gwt-2.0.0 directory.

I created an IntelliJ "GWT Configuration" to launch the application.  When I run the application, the GWT Development Mode dialog initializes.  I click the "Launch Default Browser" button and a browser window opens with:

HTTP ERROR: 404
NOT_FOUND
RequestURI=/MyApp.html
http://jetty.mortbay.org/



The MyApp.html and MyApp.css are in both the generated webapp-1.0-SNAPSHOT directory and .war file.  However, if I trim the URL in the browser from http://localhost:8888/MyApp.html?gwt.codesvr=10.27.1.11:9997 to the http://localhost:8888/ , I can navigate the files served up by the Jetty server.  The .html and .css files I can see in the webapp-1.0-SNAPSHOT directory and .war file are not shown.  So it makes sense that a 404 is returned.  But why are the files that are in the build directory and artifact not part of the server being executed from the IntelliJ Run?  What piece of magic configuration am I missing?  Thank you.

Fred

---
Original message URL: http://www.jetbrains.net/devnet/message/5253593#5253593



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Nikolay,

No I had not set the "Target Web Facet".  I missed that despite examining the panel properties multiple times.  I still have a 404 error though, this time with the myapp.nocache.js file.  The Jetty tab shows that a failed get (404) is made attempting to retrieve "/myapp/myapp/myapp.nocache.js", however if I attempt to manually retrieve "/myapp/myapp.nocache.js" the file is there.  The weird thing is even if I strip it down to src="myapp.nocache.js" in the MyApp.html file (and verified that that is the contents of the file copied into the target directory, the served up HTML in the browser is rewritten to change it to "myapp/myapp.nocache.js".  Which since the MyApp.html is being served up from a the /myapp context, it ends up with "/myapp/myapp/myapp.nocache.js".  What is causing the HTML to be rewritten?

The HTML file is in a directory named "public" under same directory as the .gwt.xml.  Thank you for any help.

Fred

0
Comment actions Permalink

Please make sure that in Web facet you have marker /war directory also as a source folder.
Than in GWT facet choose this Web facet as a "Target Web Facet".

Should work.

0
Comment actions Permalink

I did something similar to you and had a similar result. Instead of using the Eclipse plugin to generate the project, I used the GWT command-line tool called webAppCreator. The problem was that I had an old copy of generated code for a project with the same name in IntelliJ's cache, and it was this old copy that (I think) was being served from the project. Deleting this generated code and re-launching the devmode fixed the issue. On my mac, the generated code was located at: ~/Library/Caches/IntelliJIdea90/gwt/sample.sample5fc35e4b/sample.129537c8/run/www/ (my project was named 'sample').

Edit: I had a horribly wrong notion of what was going on under the covers and (as sometimes happens) discovered the truth shortly after going public with my incorrect ideas. The above represents the discovered truth. This issue was likely 100% operator error. :8}

Message was edited by: Brian Bailey

0

Please sign in to leave a comment.