I was working on my web application in eclipse with Tomcat v7.0, and everything was fine.
But today suddenly I can\'t run my poject on server anymore.
I do as usual:
I solved this by deleting the working directory of my Tomcat server, cleaning, and republishing. For reference, my working directory was:
{eclipse-workspace}/.metadata/.plugins/org.eclipse.wst.server.core
And my server was tmp0. I've seen other people have servers under different directories. I found this path after double clicking on the Tomcat server in eclipse. That brings up a configuration menu and it lists the "Server Location".
In my case it was due to a BSOD during the deploy procedure. I had a couple of corrupted files (in Tomcat config) in the destination tomcat, so eclipse could not parse them to check if a redeploy was needed.
Download and install the zip file of tomcat instead of 32 bit windows zip and 64 bit windows zip. Add it to server- Window->Pref->Server->Runtime Env
Download link
Apache Tomcat download page https://tomcat.apache.org/download-70.cgi
Also you can remove these files:
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
from $your_path/workspaceEclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings
and make new server again.
In my case, when I had same issue I understood that I previously commented out the Host node with name="localhost" in server.xml.
Example:
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"></Host>
And since then I was getting this Exception each time I tried to publish changes to Tomcat.
But the problem is, when I opened server.xml in eclipse and I removed comment brackets from this Host, saved changes and tried o publish again, I was still getting this Exception. Restarting Eclipse, deleting tmp0 folder in C:\src\trunk.metadata.plugins\org.eclipse.wst.server.core did not help.
What helped is openning server.xml in other than Eclipse editor. It is appeared that this Host stayed commented out in it, so Eclipse did not actually apply changes unless publishing is successfull. So I removed comment brackets from this Host in other text editor, saved changes, returned to Eclipse and publishing worked again!
Hope it will help to somebody.
I had similar problem, but java.lang.NullPointerException
instead.
For me the only thing that worked was to:
Hope that helps!