I've got a servlet running in tomcat, when trying to get the servlet to connect to a database. The doPost method of the servlet runs, and creates an instance of my database middleware class. During initialization, this code is what triggers the problem: con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306", "root", "test"); Code (markup): The connection works fine and gets my results as expected when I try running it as an application, but when running it in tomcat, that line seems to cause tomcat to close without reporting an error. Nothing useful seems to get saved into the logs. The connection to my browser just gets terminated without any output.
Try posting this question on stackoverflow.com too. But before that I would verify that you can: 1) connect to the db using msql client on localhost:3306 2) the driver jars are getting packaged and deployed 3) use tcpdump to see if there is any communication between your app and db.