GWT Compiler can't find gwt.xml
I have changed and renamed my package structure of my GWT project, and when trying to run the project as a web application, the module isn't found and I get the following message:
[ERROR] Unable to find 'de/xx/focus/My_Projekt.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
开发者_开发技巧[ERROR] shell failed in doStartup method
Which class is used to load the module, and where to update the new path, respectively?
I spent an hour staring at my gwt.xml file trying to figure out what I had done wrong after restructuring a project. Turned out it was in a sub-package of client instead of client itself. Right at the bottom of a long list of packages and sub-packages too. So in Eclipse's tree view, it looked like it was in the right place. Finally I realized it was one level in too deep. Face-palm time. I would also study the Run Configurations. If you are using Eclipse and you regularly do a "Run As" then "Web Configuration", this time do "Run As" and select "Run Configurations" at the bottom of the sub-menu. Go through it, tab by tab, but in particular study the "Arguments" tab and see if it needs to be updated. You can also get to the settings view the Project -> Properties -> Run/Debug Settings.
Also under "Run Configurations..." > GWT tab, I had to remove and then re-add my app's sole GWT module. Only after doing this I could run the app again.
I also had the same error. When I looked at the program arguments (Run As ----> Run Configurations... ---> Arguments) I found that com.google.gwt.sample got appended to my project name.
I removed this and it now works fine. The name of my project is SampleProject and it is in package samples
The arguments now look like below -
-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl SampleProject.html -logLevel INFO -codeServerPort 9997 -port 8888 -war D:\eclipse\myprojects\SampleProject\war samples.SampleProject
Strangely enough this problem only occurred the first time. After correcting it the first time subsequent new projects worked fine.
I think the simplest way is stopping all running projects with that specific name and then remove older run configurations for that specific project.
After that run the project again and it will be good.
I think the source of the problem is an older run configuration for the project. In my case I deleted sample code and later re-generated under the same name but as I realized at last not under the same package name. Eclipse used old run configuration for the new project because of the matching of the names.
If you use Intellij. The resource dir look like this me.wener.test.somehow
, maybe, this is only one dir with that name. not me/wener/test/somehow
.But they look the same~ shit~
I was debugging this same error, only for us it was with an Ant build that worked fine on Mac OS X but would fail on the Linux-based CI build servers.
Solution was simple... the file was named ModuleName.gwt.xml but the module was named modulename. The build would look for modulename.gwt.xml and on the Mac the filesystem is case insensitive by default so there was no problem. On linux, it couldn't find the file and we'd get this error. To resolve, just renamed the file to modulename.gwt.xml.
Also Check if you are using JRebel
it caches run configuration to do this : right click on project>> JRebel >> remove nature
add the nature again and run
This issue occurred because in the project run configuration in the arguments there is an extra or old package name appended before the original package name so once it is removed it will be works fine. In Eclipse "Run As" and select "Run Configurations" at the sub-menu select "Arguments" tab and modify the package name at the end of the argument by removing the existing package name give the package name of your project where the gwt.xml present. once done run it
Eg: 1 Below is the last sample project I have been created. [-noprecompile, -port, 9876, -sourceLevel, 1.8, -bindAddress, 127.0.0.1, -launcherDir, D:\eclipse-workspace\Sample-Porject\war, -logLevel, INFO, -style, OBFUSCATED, com.gwt.sample.Sample_Porject]
Eg: 2 Then I again created new sample package but when I run it It showed an error and it looked like below [-noprecompile, -port, 9876, -sourceLevel, 1.8, -bindAddress, 127.0.0.1, -launcherDir, D:\eclipse-workspace\New-Project\war, -logLevel, INFO, -style, OBFUSCATED, com.gwt.sample.Sample_Project, com.domain.learn.project.New_Project]
Modification In Eg: 2 the bold part is the old project package name I created it need to be removed then the project will run fine. After removing it It look like this [-noprecompile, -port, 9876, -sourceLevel, 1.8, -bindAddress, 127.0.0.1, -launcherDir, D:\eclipse-workspace\New-Project\war, -logLevel, INFO, -style, OBFUSCATED, com.domain.learn.project.New_Project]
精彩评论