Deploying app from Eclipse to GlassFish
Well I faced it and for me it worked with two ways:
- I deleted the server and added the new server (as mentioned in the previous comments)
- Just right click on GlassFish Server -> Click Add and Remove -> Remove All -> Add All -> click Finish.
So try any of them. :)
For me this bug occurs as follows. Deploy a war application with eclipse using Glassfish tools integration. Then, using the administration console, undeploy the application (not going through eclipse, thus). Then modify anything in the eclipse application (so that it gets dirty), and ask eclipse to re-publish it. Eclipse says: “cannot Deploy dukes-age, deploy is failing=Application with name [dukes-age] is not deployed.” (And indeed the application is not deployed.) Same thing after restarting eclipse and glassfish.
Workaround: rename the eclipse project, deploy it: it gets deployed. Then rename it back to its original name, deploy: it gets deployed.
I reported it to glassfish JIRA (please confirm or comment there if you also see this bug).
I had the same problem, and searched a lot on line, solved just by delete the Glass fish server and reset another, voila...
While the accepted answer will probably work, it is not the best solution for me. The problem will most likely occur again and then we need to repeat.
The following answer worked for me: https://stackoverflow.com/a/30507834/1934673
I don't know exactly why it works with jars and sometimes fails if the checkbox is not checked. The good news is that this way we work around the bug and we don't need to remove server - create server every time the bug happens. The bad news is that using jars is working way slower.