GWT,Eclipse插件如何重命名项目以及.gwt.xml文件?尝试这样做时会得到错误 [英] GWT, Eclipse Plugin how to rename project along with .gwt.xml file? Am getting error when try to do so

查看:318
本文介绍了GWT,Eclipse插件如何重命名项目以及.gwt.xml文件?尝试这样做时会得到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了一段时间寻找这个,没有什么,我发现似乎与我的问题有关。我正在进行RPC调用,所以我想改变我的一个Web服务的路径。



这是像$ code> mytestproject 并希望将其更改为 finalprojectname



我去了 mytestproject.gwt .xml 文件,并将
< module rename-to ='mytestproject'> 更改为模块rename-to ='finalprojectname'>



然后我运行它,并得到一个错误, [ERROR ]无法在您的类路径上找到org / ediscovery / gwt / mytestproject.gwt.xml;可能是一个打字错误,也许你忘了为源代码添加一个类路径条目?



然后我更改了 mytestproject。 gwt.xml finalprojectname.gwt.xml 但仍然得到相同的结果。



我查看了每个可能的文件,找不到为什么它认为项目仍然命名为 mytestproject 。我已经清理和重建项目等,但仍然是一样的。我对Java还是比较新的,所以也许我缺少一些明显的东西。如果有人可以提供任何建议,我将非常感谢。感谢

解决方案

将项目从mytestproject重命名为finalprojectname:


  1. 在.gwt.xml文件中,更改

    rename-to =mytestproject

    rename-to =finalprojectname


  2. html文件,更改

    src =mytestproject / mytestproject.nocache.js

    src =finalprojectname / finalprojectname.nocache.js(注意双重替换!)


  3. 在您的web.xml文件中,调整像

    < url-pattern> / mytestproject / greet< / url-pattern>

    < url-pattern> / finalprojectname / greet< / url-pattern>


其他任何东西(如重命名包或重命名.gwt.xml文件)是可选的。



如果您确定以后重命名.gwt.xml文件,那么有必要删除输出文件夹(war / finalprojec TNAME)。在Eclipse中,还可以删除旧的运行配置,然后使用运行方式> Web应用程序创建一个新的。


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

解决方案

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".

这篇关于GWT,Eclipse插件如何重命名项目以及.gwt.xml文件?尝试这样做时会得到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆