Sponsored Link

Friday, July 27, 2012

Maven:: Invalid CEN (bad signature) Invalid LOC (bad signature)

So, you are here, and I guess you are having a tough time trying to figure out what that error is. I'd spent almost three days trying to figure out what this crazy error is, but then decided to not waste time and deleted my Maven repository folder at ~/.m2/repository.

I assume that, this is some bug in maven, but this also pops up in several other projects like Apache Tomcat, Atlassian Confluence etc. The error comes up randomly and developers spent a great portion of their fruitful work time, just to figure out whats going wrong. And most of the time it is not their fault.

This error comes up randomly and means that one of the jar file in the project class path is corrupt. A practical solution is to replace the jar files with new ones freshly downloaded.

This crazy error show up when the JVM thinks that the jar file it is accessing is corrupt. So I assumed if I delete the dependency jar files and download them again, it might solve the problem.

#delete repository
rm -rf ~/.m2/repository/*

#use maven
mvn test

This deletes all files from ~/.m2/repository/ first and then, mvn test will download all dependent jar files before building the project and running junit tests. It took a while for Maven to download all my dependencies, but was worthwhile. The project is back in action!!!

If you are not using Maven or any other dependency management tool, you may try downloading the required jar files again, may be from a different source, if the file in that source is corrupted. This error may also come up when checking out from repository.

Monday, July 16, 2012

Ubuntu:: How to Change the Computer Name

Changing computer name in Ubuntu is easy.In Linux computer name is represented as 'hostname' and this name can be used to identify a Linux box in a network. To display current hostname on your linux machine

$ hostname

To change hostname for current session

$ hostname new_host_name.my_domain

To change hostname permanently

  1. Open /etc/hostname file as root
  2. $ sudo vi /etc/hostname
  3. Change the name and save the file
  4. New hostname will take effect after the reboot.
  5. You will also need to update the /etc/hosts file with the same computername

Note that, the new name will take effect after you restart the machine. If the same hostname is configured on any other machine in the network, system may fail to boot or won't be available in the network.

Related Posts Plugin for WordPress, Blogger...