tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfonso Alba García <>
Subject problem with security manager, plesk and mysql (catalina.policy ignored?)
Date Fri, 29 Oct 2004 22:21:36 GMT
Hi everybody,

I have problems when connecting to mysql. I'm getting the following
exception when trying to connect to a mysql database:

(SQLException): java.sql.SQLException: Unable to connect to any hosts
due to exception: access denied
( localhost resolve)

I have read about similar problems in google and tried to modify the
catalina.policy without success.

I deploy applications via a Plesk web interface which loads my .war
file, sets it in /var/tomcat4/psa-wars/ creates a symlink 
to the war file in /var/tomcat4/psa-webapps/ and makes the
application available via

It works fine except when an application tries to access a mysql
database. I´m getting the exception above, even though I tried the
following lines in catalina.policy without success (found similar
exeptions to this one in google):

grant codeBase
"file:${catalina.home}/psa-webapps/" {
      permission "localhost","resolve";

grant codeBase
      permission "localhost","resolve";

I tried both of them one at a time and I restarted tomcat after every
modification made to the catalina.policy

I´m using tomcat 4.1.24 on a redhat linux Enterprise server, with
/mysql-connector-java-3.0.9 and jre 1.4.2.

Tomcat and mysql are in the same server.

The way I´m trying to access the database in a jsp is 
conexion =

I've checked that the database exists, I can connect to the database
from a console as user USER with password PASSWORD.

The application works perfectly well in another server (debian woody
with tomcat 4.0) where it was not necessary to modify the security

I talked to a friend of mine who also knows something about tomcat and
told me that to access a database in the same server where tomcat is, it
should not be necessary to modify the catalina.policy file.

I have some experience with tomcat but i run out of ideas and things to
try. Any help to open my eyes would be appreciated.

Thanks a lot in advance,


View raw message