问题
For a long while we were running our GWT-based application in Eclipse using custom subclasses of com.google.gwt.core.ext.ServletContainerLauncher and com.google.gwt.dev.DevMode.
This was to allow us to run our custom (newest) Jetty and, over time, it gave us some other control, i.e. launching the server just a bit differently in Eclipse so as to allow files to be spread around Eclipse projects instead of being where they end up in production.
These were effectively displacing/reimplementing/overriding bits of JettyLauncher.java and DevMode.java
Right now I am trying to upgrade to GWT 2.7 and this no longer works. Specifically it starts with:
Started code server on port 9997
Loading modules
com.<...>.ClientDev
Public resources found in...
Translatable source found in...
Starting HTTP on port 8008
All I get is that the infamous "GWT module "client" may need to be (re)compiled". I see that the Eclipse launch configuration now offers the choice between super dev mode and a "classic" one. I didn't change that yet (still at "classic") but the idea is that we need to move on to Super Dev Mode (predominantly because of speed and support, but classic features and debugging in IDE will be missed).
I tried to find documentation on what changed (or needs to be changed in code such as mine) to get over to 2.7 but failed so far. Can anyone help?
Thanks!
回答1:
I didn't find any documentation but I succeeded to get started. Here are the things that I had to do:
- I actually didn't have to change my launcher/dev mode code at all.
- Eclipse *.launch file had to be modified to add -nosuperDevMode argument. I could not get the super dev mode to work within it due to the conflict between its own embedded container and my newer version and I did not want to spend time solving this.
- Create a new way to independently launch com.google.gwt.dev.codeserver.CodeServer with the following arguments: -bindAddress [same-address-as-for-the-main-one] -port 9876 -launcherDir [war-folder-path] [GWT-module-name]
- Clear all the cookies. CodeServer had buffer overruns (http error 413) because I had too many cookies for it.
- Access the CodeServer URL directly to add the two bookmarklets (Dev Mode On, Dev mode Off) to the browser.
- I precompiled my app once just to make sure I have the structures but this should not be necessary, I think.
- Start my server first.
- Start the code server second.
- Turn dev mode on using the bookmarklet.
- Access my app.
来源:https://stackoverflow.com/questions/30091786/how-to-migrate-a-a-custom-sublass-of-gwt-devmode-to-gwt-2-7-0-super-dev-mode