gwt-eclipse-plugin
gwt-eclipse-plugin copied to clipboard
SuperDevMode does not start automatically
I'm using a project structure based on the tbroyer multi-module archetype. I have the facet project properties configured to launch super dev mode, but I always get the following error in the error log of eclipse.
!ENTRY com.gwtplugins.gwt.eclipse.wtp 1 1 2017-01-05 14:59:31.955 !MESSAGE GWT: posiblyLaunchGwtSuperDevModeCodeServer: GWT Facet project properties, the code server sync is off.
It would be useful if it would tell me which project it is looking at. I have configured the client/server and shared projects to enable the feature but the plugin is apparently looking somewhere else ?
Any feedback ?
Good point. I've marked it as a bug and will add more logging on the next round.
If you haven't gone down this route already, what I would suggest doing to narrow it down is close project in your workspace to drill it.
Things are working smoothly. I'll continue to test, but so far, things seem better.
Things are working as expected in tests.
I'll do some testing on my own projects tomorrow. thanks.
Quick note, the are in the staging/snapshot repository and not production yet.
OK, I did a build of the master branch and tried it out. It still doesn't work though. The problem is that the wrong project seems to be detected. I have several gwt-lib modules and multiple gwt-app and war modules in my workspace. The plugin seems to try to run de codeserver with the first gwt-lib project it finds. The codeserver reports this error: Usage: at least one module must be supplied.
I need to figure out how to replicate your project so I can test this config. Could you make a project test case I could use for testing?
I just noticed my snapshots weren't uploading to the staging/snapshot repo. It should be up soon, if all works as expected. So the changes haven't been updated yet.
I will try to create an example project setup that exposes the problem. I need to do this on my computer at home (Enterprise hell)
Sounds good, thanks.
Trying to reproduce by creating a new project.
- Create a new multimodule project (using 1.0-SNAPSHOT of tbroyers archetypes) Started tomcat with the server project. Error log states that the project (does not say which one) does not have a GWT Facet.
- Added (manually) the GWT Facet to the server project Error log still states that the project does not have a GWT Facet
- Added (manually) the GWT Facet to the client project Now it all starts automatically.
So some questions: How can I get eclipse to add the GWT Facet automatically when importing the maven project ? Maybe a fix is required in the GWT maven archetype ?
I will continue now to see what happens when I add gwt-libs in the mix. Keep you posted.
Added gwt-lib projects... but it keeps on working properly! So there must be something very specific to my pom files that causes my problem. Not sure how to progress, I cannot share my full application workspace with you. I guess you can close this issue until I can reproduce and proof that it is a problem in the plugin or my own pom mistakes.
Aha, I'm reaching some conclusions now. I have multiple gwt-libs that have the GWT Facet enabled in the eclipse projects. It looks like the GWT plugin is assuming the very first project to contain the entry point for the war.
So I removed all the GWT Facets except for the gwt-app project. But then I still got an error that somehow the plugin did not detect which module to run.
I changed the generated launch config to start my module and now it works!
I am not sure if this GWT facets will not get reset when I do a maven update projects in eclipse.
If the facet isn't getting wired up on import of the gwt project, that's a maven configurator issue in the plugin. The GWT plugin has to be available in the pom.xml for it to be turned on.
I'll test importing the archetypes on my next round of fixes and verify that the configurator is adding the facet. Thanks for the report.
the maven plugin is in the pom, so I don't think I am doing anything wrong there. Anyway, I'm soo happy that it works now, it makes debugging and launching soo much easier. Great work, thanks.
Cool, good to hear the about the debugging. I've noticed at times things don't autowire and tried to solve those on the last fixes. I'll keep this open and do some more investigation to see if I can replicate it. Thanks for the feedback too!
After doing a maven project update the GWT facets are back on my gwt-lib projects and as a consequence the auto launch feature does not work anymore. It does not make sense to select a gwt-lib project, it only makes sense on a gwt-app project.
I looked a bit at the implementation of the plugin (I don't know much about eclipse plugin development) and found this interesting class.
The method getGwtFacetedProject has an interesting TODO marker. According to the comment it will use the first project with a GWT Facet it finds. That explains a lot.
But now I also better understand what is going wrong in my project setup.
I have a few gwt-libs that also contain server-side code. So as a consequence the war project refers to them and that is why the gwt eclipse plugin decides to use them iso my gwt-app project to launch. This will probably happen only if one of those gwt-libs are in the list of modules before the gwt-app.
I guess I can solve this by splitting these kind of projects in a GWT client only project and a server side one that does not refer to the gwt maven plugin.
Gotcha, thanks for showing me that. So I need to setup a test case so I can work that out.
Hi!
I found another issue with GWT: possiblyLaunchGwtSuperDevModeCodeServer: Does not have a GWT Facet.
My project structure is simple:
|- main-project-module
|--- gwt-module (client & server)
|--- utils
|--- persistence
When I deploy the gwt-module
to Eclipse's Tomcat server, I publish only one modle gwt-module
. The other moduels aren't web-apps and can't be published at all, it is ok. They are just dependencies of gwt-module
. The persistence
module even has gwt module descriptor to be able to use some it's classes from gwt-module
's client side.
But from the Tomcat server perspective the published gwt-module
module has submodules: utils
, persistence
. So when published, it looks like:
Tomcat 8.0 server at localhost
|- gwt-module
|--- utils
|--- persistence
To be more clear, there is screenshot:
The only module which has GWT facet is gwt-module
(point-manager
on screenshot).
The Sync
flag is ON.
But I still get the error GWT: possiblyLaunchGwtSuperDevModeCodeServer: Does not have a GWT Facet.
when I start Tomcat.
I really don't know why this happens, but have a guess: I looked at GwtFacetUtils.getModules(...) function and I think it can't find my main gwt module because it looks at child modules first, and, if any child modules found, it returns just these child modules, ignoring parent module:
// Multi-module project
IModule[] modules = server.getChildModules(server.getModules(), new NullProgressMonitor());
if (modules == null || modules.length == 0) { // does it have multi-modules?
// So it doesn't have multi-modules, lets use the root as the module.
modules = server.getModules();
}
It return parent modules only if child modules are not found.
But in my project it is parent module is actually has GWT facet. It is parent module should be lauched in CodeServer.
I think the simple solution is to modify getModules
method to return the full list of modules at any level of hierarchy, recursively doing server.getChildModules
and including all found modules (parent and child) in returned array.