Normal users can't control Tomcat server. If you want to start/restart/shutdown Tomcat, you must use "sudo". For developers, restarting Tomcat is very frequent, therefore, typing "sudo" again and again becomes a dirty work.
Problems about MySQL connection. The default bootstrap of Tomcat is /etc/init.d/tomcat5.5 and it starts Tomcat server automatically. But the serious problem is: Tomcat con't connect to MySQL database! I don't know why. However, if I start Tomcat with /usr/share/tomcat5.5/bin/startup.sh, Tomcat can connect to MySQL. Why the two methods to start Tomcat are different?
Class loading problems. I wrote my first servlet that can connect MySQL with JDBC and found some strange problems. I create three files:
- Database.java: the database class, which encapsulates some database operations;
- DBTestServlet.java: the servlet class that calls Database class to operate database.
I don't know why Ubuntu's Tomcat package has so many problems. Perhaps the best solution is to download Tomcat from http://tomcat.apache.org/ and extract it to a directory instead of using "sudo apt-get install tomcat5.5".