tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: [OT] database error
Date Tue, 20 Sep 2011 17:31:09 GMT
Hash: SHA1


(Marking off-topic because I don't think this is a Tomcat-specific issue)

On 9/18/2011 10:52 AM, Dave Filchak wrote:
> Error initializing sub-systems: Please check the following: 1.
> That your machine has a valid connection to 
> jdbc:mysql://localhost/exodus_exodus Using: Username: xxxxxx 
> Password: xxxxx Driver: com.mysql.jdbc.Driver

That's not a Tomcat error message: are you doing your own database
connection management (or do you know if you are)?

> I have verified that the user/pass is correct via a command-line 
> log in.

Did you do that from the same machine where Tomcat runs?

If you are using a *NIX machine, you can connect using a named pipe OR
using sockets. If you have "skip-networking" set in /etc/mysql/my.cnf
then MySQL will not listen on a socket and you must connect using the
named pipe. Connector/J can't use the named pipe: it must use TCP/IP
for communication. So, make sure you haven't disabled sockets for MySQL.

> So, then checking the 
> /home/xxxxx/public_html/WEB-INF/conf/environment.xml, it all looks 
> correct as far as the database info is concerned.

AFAIK, WEB-INF/conf/environment.xml isn't used by Tomcat to initialize
any kind of database connection or DataSource (aka "connection pool").

> I do notice that things like the <path> in this file contains 
> entries that are wrong. For example, 
> <systemLogFolder>/usr/local/tomcat/webapps/exodus/WEB-INF/logs/</systemLogFolder>
should actually be
> <systemLogFolder>/usr/local/jakarta/tomcat/webapps/exodus/WEB-INF/logs/</systemLogFolder>except
that the exodus folder does not exist under webapps.

So the path is wrong and so is the path you think it should be? I'm

So... Jakarta? What version of Tomcat are you using?

> This misconfiguration is consistent with all the entries under 
> <path>. The entire exodus app is actually under the web root so I 
> am not sure what if anything I would have to do here. Should I 
> simply create these folders under 
> /usr/local/jakarta/tomcat/webapps/ ??

Probably not. You probably don't want things like logs to be put into
the webapp's deployment directory: they will be deleted if you
undeploy the webapp :(

Try putting them in /usr/local/jakarta/tomcat/

> As I really do not have a load of experience with tomcat, I wold 
> appreciate any insight anyone can give be as to how I might go 
> about repairing this error.

The real question is how your JDBC connections are being managed. It
doesn't sound like Tomcat is being asked to do anything... maybe it's
some other component (like Spring) or maybe your web application
itself manages it's own database connections. You'll have to find that
out, first.

My from-the-hip expectation is that you are missing the Connector/J
JAR file. If your webapp is managing the connections, you should
probably have the JAR file in your webapp's WEB-INF/lib directory and
nowhere else.

There may be a memory leak if you do this (depending on your Tomcat
version and whether or not you use the DriverManager -- though I think
Connector/J self-registers so you don't have a choice in the matter).

Your will have a more-stable server if you can afford to put your
mysql-x.y.z.jar file into CATALINA_BASE/lib (or
CATALINA_BASE/common/lib depending on the version of TC you are
running). (You might not be able to do this if you have different
webapps that need different versions of the Connector/J library).

Hope that helps,
- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message