Sunday, May 22, 2016

Linux : How to get Network Driver Details

If you are looking for a command to query the network card driver details such as name and version, run the ethtool command  with either -i or --driver option followed by the network interface name.

[parag@clara ~]# ethtool -i eth1
driver: via-rhine
version: 2.4.9
firmware-version: 
bus-info: 0000:03:00.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
[parag@clara ~]# ethtool -i eth0
driver: tg345
version: 13.8
firmware-version: nb vs.49
bus-info: 0000:02:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
[parag@clara ~]# 
[parag@paragcentosvm:/home/parag]ethtool --driver eth0
driver: e1000
version: 7.3.21-k8-NAPI
firmware-version: 
bus-info: 0000:00:03.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

Sunday, May 01, 2016

Jetty Web Server Giving java.util.zip.ZipException: invalid entry size Exception

Today I ran into a bizarre error on Jetty WebServer. I have a few web-sites and services hosted on a Jetty server version 9.3.6.v20151106 running on a Centos 6.4.
I made some changes in a web service code and deployed the binary to my Jetty webapps directory, as soon as I started my Jetty server, it started showing me errors :


[parag@centosvm:/services/jetty-distribution-9]java -jar start.jar 
2016-05-01 17:41:00.380:INFO::main: Logging initialized @625ms
2016-05-01 17:41:00.493:WARN:oejs.HomeBaseWarning:main: This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommended.  See documentation at http://www.eclipse.org/jetty/documentation/current/startup.html
2016-05-01 17:41:00.911:INFO:oejs.Server:main: jetty-9
2016-05-01 17:41:00.959:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///home/parag/jetty/webapps/] at interval 1
2016-05-01 17:41:01.598:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@6093dd95{/staticpages,file:///home/parag/jetty/webapps/staticpages/,AVAILABLE}{/staticpages}
2016-05-01 17:41:08.060:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@32464a14{/wallsoft-x-web,file:///home/parag/jetty/webapps/reactJSSite/,STARTING}{/abcd}
java.util.zip.ZipException: invalid entry size (expected 11658 but got 11664 bytes)
 at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:384)
 at java.util.zip.ZipInputStream.read(ZipInputStream.java:196)
 at java.util.jar.JarInputStream.read(JarInputStream.java:207)
 at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:140)
 at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:118)
 at java.util.jar.JarInputStream.getNextEntry(JarInputStream.java:142)
 at java.util.jar.JarInputStream.getNextJarEntry(JarInputStream.java:179)
 at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:939)
 at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:851)
 at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
 at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:548)
 at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
 at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
 at java.lang.Thread.run(Thread.java:745)
I did a quick search on the internet and stackoverflow ofcourse for finding the problem cause and resolution and did not come across anything concrete. 
However in this particular answer, people had reported it could be due to a corrupt maven repository jar. How in the world it could have happened I do not know. No recent maven packages were downloaded (just incremental changes to code, no new package dependency). 
And I was able to run zip/unzip commands normally, as well as on .war files. Anyhow after spending close to 30 min, I decided to give the answer a shot and deleted my .m2/repository folder, rebuild my project, copied the binaries again and viola it worked :) 

[parag@centosvm:/home/parag] rm -rf .m2/repository/


Using Tcpdump to dump and read network traffic

Another Quick FYI tip. There are many network analyzer/reader utilities available on both Linux and Windows platform. There is of-course ...