tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gregor Schneider <rc4...@googlemail.com>
Subject Re: tomcat only query localhost database
Date Tue, 03 Feb 2009 09:16:03 GMT
Sorry, but you're providing too few informations.

- please post the file /etc/tomcat6/Catalina/localhost/webappName.xml
(masquerade the user-id / password!)

- please post the piece of code where the said webapp tries to create
the database-connection.
should looke similar to

<code>
	    try {
		Context env = (Context) new InitialContext()
			.lookup("java:comp/env");
		dbDS = (DataSource) env.lookup(dataSourceName);
		if (dbDS == null) {
		    logger.error("seems that '" + dataSourceName
			    + "' is an unknown DataSource");
		    throw new ServletException("'" + dataSourceName
			    + "' is an unknown DataSource");
		}
	    } catch (NamingException e) {
		logger.error("Exception caught:", e);
		throw new ServletException(e);
	    }
</code>

My guess is, that within the app's code, the connection to the
database is not established to the said datasource but that somewhere
"localhost" is hardcoded.... *sic*

So have a chat with the webapp-developer and let us have a look at the code.

Rgds

Gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message