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开发者_如何学JAVA 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
To rename a project from "mytestproject" to "finalprojectname":
In your .gwt.xml file, change
rename-to="mytestproject"
to
rename-to="finalprojectname"
.In your .html file, change
src="mytestproject/mytestproject.nocache.js"
to
src="finalprojectname/finalprojectname.nocache.js"
(note the double replacement!)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".
精彩评论