Hi,
I had a problem with adding and removing modules to an web application project.
The problem was that the application.xml didn´t contain the right values.
e.g.
cnsApp (Application)
cnsWeb1 (Web project)
cnsWeb2 (Web project – branch of cnsWeb1)
cnsEJB1 (Bean)
cnsEJB2 (Bean)
I added cnsWeb1 to cnsApp with add module and it was correctly added to the xml.
same for cnsEJB1 and cnsEJB2.
After adding the cnsWeb2 the xml lost cnsEJB1 and cnsEJB2 and only contained cnsWeb1 but not cnsWeb2
No matter how often I tried to remove and add again, I got different xml´s but never the one containig all modules.
I searched toe forum and did some things which helped other people with problems that are close to mine, but nothing helped (-clean to startup, recreate the application project, …)
So I spent lot of time to search the error but, YEHAA 🙂 I found it.
When creating a web module it gets an id this id is stored in the .mymetadata of the project
cnsWeb2 was a branch checkout of cnsWeb1 with just another root context
so both web projects had the same id (because a branch is only a copy from the original project)
So the workaround if you have this behavior is to simply change the id in the .mymetadata file to a unique one.
I would say, this is a kind of “feature” that should be reworked, a path checking or on the fly ID creation would save much time for customers searching errors.
If you don´t want to edit the .mymetadata file you can create a new project and move all sources from the copy to the new one and use this. (my Project comes from SVN so for me it´s better to just edit and commit the changes)
It was really annoying and nearly made me trash my MyEclipse licences.