Friday, June 4, 2010

Problem with MySQL and Tomcat Turnkey Appliances connection solved

After two frustrating days of testing, testing and guess what? More testing! Er… sorry for being a little bit rude, but I haven’t slept well in two days…  Let me start again… After two frustrating days of testing & debugging, I finally solved the communication problem between my MySQL and my Tomcat Turnkey Appliances.

The following error kept showing up at my Mozilla Firefox screen:

Error 1: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure Last packet sent to the server was 0 ms ago.)

The problem is that the Tomcat Turnkey Appliance includes Tomcat 5.5 and it comes along with a lot of security restrictions. So I had to add the following line to the $TOMCAT-CONFIG/policy.d/04webapps.policy file:

permission java.net.SocketPermission "127.0.0.1:3306", "connect";

And all this thanks to kalkulator-kredytowy´s answer at http://stackoverflow.com/questions/2172570/tomcat6-cant-connect-to-mysql-the-driver-has-not-received-any-packets-from-the

Posted via email from alromero's posterous

No comments:

Post a Comment