Pages

Showing posts with label Errors. Show all posts
Showing posts with label Errors. Show all posts

Thursday, April 26, 2012

Set max connections in MySQL database

Problem Statement: I was working with MySQL database and all of a sudden my code started throwing this error.

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection,  message from server: "Too many connections"

The similar kind of error I got in MySQL Workbench also. Here is the snapshot.























Problem Solution: Increase the maximum concurrent connections. You can do this with the command below.

set global max_connections = 1000;

Friday, April 20, 2012

Apache ANT error : Unable to locate tools.jar

Problem Statement: While doing an ant build, if you get an error message saying
Unable to locate tools.jar

Problem Solution:
Follow the steps to resolve this issue.
  1. See if you have environment variable names JAVA_HOME, if not create it
  2. In Linux and Mac, Copy following statement and append to /etc/profile or .bashrc file, make systec set JAVA_HOME into system environment variable.
    export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.06"
  3. In Windows, go to environment variables and add new variable with name JAVA_HOME and the value as Java's location wherever installed.