What I Learned Today
Bind Address in Use error

I was getting this error when trying to start tomcat:

java.net.BindException: Address already in use:8080
LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in use:8080

To fix this, I followed these instructions:

  1. Find the zombie process holding the port open: netstat -anp | grep 8080
  2. use kill -9 to stop it
Recovering Crashed Mysql tables

If you see error messages in /var/log/mysql.log about a table being crashed, log into the mysql console and run:  recover table;

Pretty easy!

For tpcw, you can use this script to recover everything:

repair table item;
repair table country;
repair table author;
repair table customer;
repair table orders;
repair table order_line;
repair table cc_xacts;
repair table address;
repair table shopping_cart;
repair table shopping_cart_line;

TPC-W database.properties problems

Tomcat was crashing everytime I tried to access the TPC-W site. The catalina.out file listed an error saying it couldn’t find the database.properties file. This was very strange because sometimes the site worked fine, and other times it would crash.

To fix this, I edited the $CATALINA_HOME/bin/setclasspath.sh file to make it include $CATALINA_HOME/lib/ on the classpath, then made a symlink in that folder to the correct database.properties file.

I was worried this would be a problem for running both RUBIS and TPCW on the same tomcat system, but it is not an issue since RUBIS calls the file “mysql.properties”.

phew…