Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT, Eclipse Plugin how to rename project along with .gwt.xml file? Am getting error when try to do so

I've spent a while searching on this and nothing that I find seems relevant specifically to my issue. I am making RPC calls so I wanted to change the path to one of my web services.

It was something like mytestproject and wanted to change it to finalprojectname

I went to the mytestproject.gwt.xml file and changed <module rename-to='mytestproject'> to <module rename-to='finalprojectname'>

I then ran it through and got an error that [ERROR] Unable to find 'org/ediscovery/gwt/mytestproject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

I then changed mytestproject.gwt.xml to finalprojectname.gwt.xml but still got the same result.

I've looked through every possible file and can't find why it thinks the project is still named mytestproject. I have cleaned and rebuilt the project, etc but still the same. I am still fairly new to Java so maybe I am missing something obvious. I would greatly appreciate if anyone can offer any advice. Thanks

like image 667
Rick Avatar asked Feb 11 '11 04:02

Rick


1 Answers

To rename a project from "mytestproject" to "finalprojectname":

  1. In your .gwt.xml file, change
    rename-to="mytestproject" to
    rename-to="finalprojectname".

  2. In your .html file, change
    src="mytestproject/mytestproject.nocache.js" to
    src="finalprojectname/finalprojectname.nocache.js" (note the double replacement!)

  3. In your web.xml file, adjust paths like
    <url-pattern>/mytestproject/greet</url-pattern> to
    <url-pattern>/finalprojectname/greet</url-pattern>

Anything else (like renaming packages, or renaming the .gwt.xml file) is optional.

If you do choose to rename your .gwt.xml file afterwards, then it's necessary to delete the output folder (war/finalprojectname). In Eclipse, also delete your old Run Configuration, and then create a new one by using "Run As > Web Application".

like image 131
Chris Lercher Avatar answered Sep 20 '22 04:09

Chris Lercher