I have a Webproject using maven and when I try to deploy it to Tomcat 7, I get the following message:
Publishing failed
Could not publish to the server.
java.lan
Most probably some jar of your local maven repo that are included in your .war as dependency are corrupted. As jtsnr suggested, you can deploy your .war outside Eclipse to discover which jar is corrupted. But there is a quicker solution. Just locate the /target dir of your maven project (or just unzip the .war) and locate inside the *.jar files (should be under WEB-INF/lib). Now, with a simple zip tool (e.g.: 7-Zip) select all and extract. You will receive a prompt for each corrupted file you have: after this, locate the file in your Maven repo and delete the entire version for that file. In this way, if you have a big repo, you gain a lot of time avoiding to re-download the entire jar ecosystem :) HTH..
The maven repository can be corrupt. It is best to remove the complete repository and update all projects in the workspace.
Lets try once the way it is mentioned below. so please delete the previous installation. Step 1 Create a new Server run time (Window -> Preferences -> Server -> Runtime Environments). Step 2 Add Server to Eclipse (Window -> Show View -> Servers) add a new server configuration (right-click and select New -> Server) but DO NOT ADD ANY PROJECTS TO IT. Step 3 Open Server Overview page Double click the new server configuration to bring up the Server Overview page where we set port and time out for the Server. Step 4
Under Server Locations select Use Tomcat installation. Save.
You should be able to start your server now. Now add your project to the server and you're ready to go.
Although this question has been answered - it was a problem with a corrupt repository, it is possible to determine which jar in your repository is corrupt by deploying the war to Tomcat outside of eclipse.
In my situation Tomcat then reported in its log where the problem lay (guava-13.0.1.jar):
SEVERE: Unable to process Jar entry [com/google/common/collect/package-info.class] from Jar [jar:file:/C:/Java/tomcat/apache-tomcat-7.0.42/webapps/myapp/WEB-INF/lib/guava-13.0.1.jar!/] for annotations java.util.zip.ZipException: invalid LOC header (bad signature)