I got the answer to my vexing problem. The reason , it was not working is that , the web project first needs to be added to the ear, which is done following the steps below :
EAR > right-click > Properties > Project References
.
And voila, now when you try to add or remove your project ear, it will start working perfectly.