hibernate-commons-annotations-4.0.1.Final.jar; invalid LOC header (bad signature)?

This looks like a problem of corrupt jars being downloaded. I have seen this happen only when I use eclipse. Here's what I did to get rid of this problem:

  • Delete contents from C:\Users\Bhanu.m2\repository. Either everything or selectively - your choice.
  • Then use the command prompt to force download jars and build

    mvn clean install
    

I will tell you what I did

I was getting the same error in common-logging so I went to C:\Users\admin.m2\repository\commons-logging and deleted the directory. The problem was solved next time I compiled.


It Throw Because your hibernate-commons-annotations-4.0.1.Final.jar is Invalid Or Corrupted.

Follow the Steps:

Note : .m2 Folder is Hidden by Default. UnHide the Folder.

Step 1:Delete all the Content in .m2/repository Folder.

Step 2:Restart Your Eclipse.

Step 3:Maven->Update Project .Checked- Force Update of Snapshots/Releases.

Step 4:Run as Maven Clean.

Step 5:Run as Maven Install.

Step 6: Clean Project.

Step 7 : Run Your Project.

I Hope you Find your Solution Here..

Thanks..


The reason is a corrupt jar file. Use mvn dependency:purge-local-repository to delete und reload your dependencies in your local maven repository.


I know this is an old thread, but I have faced the same problem (albeit with a different jar file).

In eclipse, when a maven build fails because of corrupt LOC header, a warning is generated (in my case it was spring-tx-3.0.3.RELEASE.pom but could be any other maven dependancy).

Go up in build stack-trace and figure out which JAR is failing, delete the corresponding repo folder from .m2 repositories and rebuild, that should do the trick.