You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Richard Mixon (qwest)" <rn...@qwest.net> on 2005/02/22 01:39:23 UTC
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? New approach [SOLVED]
OK, yes it turned out to be one of those "dumb" configuration errors -
BUT also a difference in how Tomcat 5.5.7 (or maybe is is Commons DBCP
1.2.1) behaves under Windows versus Linux.
I had camelcased the "username" property in the context.xml "<Resource "
tag as "userName". This worked under Windows, but NOT for Linux.
Anyway, all seems to be working great now that I used just plain
"username".
Thanks for the earlier help and suggestions.
- Richard
Richard Mixon (qwest) wrote:
> We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL
> Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on
> both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and
> production).
>
> In order to get failover to work the way we wanted we upgraded to
> Tomcat
> 5.5.7 and Sun Java 1.5. The main change in our application was the new
> format for data soruces in the application context. No problem on
> Windows XP. We've tried to install on one of our Linux servers and are
> having no end of grief getting a DB connection to properly happen.
>
> Any help or ideas would be much appreciated. I've included the
> application context and the catalina log error messages below.
>
> Thanks in advance - Richard
>
>
> ***-> APPLICATION CONTEXT:
> <Context path="/stars" docBase="stars" debug="99" reloadable="true"
> privileged="true" antiResourceLocking="false"
> antiJARLocking="true"
>>
> <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="stars." suffix=".log" timestamp="true"/>
> <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
> driverName="com.mysql.jdbc.Driver"
>
> connectionURL="jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec
> t=true&autoCommit=true" connectionName="ltojsw"
> connectionPassword="586579" userTable="PoAssociate"
> userNameCol="userid" userCredCol="password"
> userRoleTable="PoUserRole" roleNameCol="roleName" /> <Resource
> name="jdbc/stars" type="javax.sql.DataSource"
> auth="Container"
> maxActive="100"
> maxIdle="10"
> maxWait="10000"
> defaultAutoCommit="true"
> userName="ltojsw"
> password="586579"
> driverClassName="com.mysql.jdbc.Driver"
>
> url="jdbc:mysql://192.168.11.3:3306/ltojsw?aut
> oReconnect=true&autoCommit=true"
> removeAbandoned="true"
> removeAbandonedTimeout="60"
> logAbandoned="true"
> />
> </Context>
>
>
> ***-> CATALINA ERROR MESSAGES:
>
> <SNIP>
> 19:37:27,642 INFO [http-8080-Processor25]
> DatasourceConnectionProvider:51 - Using datasource:
> java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25]
> TransactionManagerLookupFactory:33 - No TransactionManagerLookup
> configured (in JTA environment, use of process level read-write cache
> is not recommended)
> AbandonedObjectPool is used
> (org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool@6239da8a)
> LogAbandoned: true RemoveAbandoned: true
> RemoveAbandonedTimeout: 60
> 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could
> not obtain connection metadata
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (Server connection failure during
> transaction. Due to underlying exception: 'java.sql.SQLException:
> Access denied for user ''@'kingfishS11' (using password: YES)'.
>
> ** BEGIN NESTED EXCEPTION **
>
> java.sql.SQLException
> MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES)
>
> STACKTRACE:
>
> java.sql.SQLException: Access denied for user ''@'kingfishS11' (using
> password: YES) <SNIP>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Richard Mixon (qwest) wrote:
> Sorry to repost - but, except for some great suggestions from
> Shakeel, I have not made much progress on this. To my way of thinking
> this seems maddenly simple - either a config error or possibly bug.
> But what?
>
> So my first place to start is to try and see where it is that the
> userName property get mangled or swallowed. I've double checkd and it
> is correctly specified in my context.xml But by the time the failure
> occurs, it is a null or empty string.
>
> So, how can I enable logging on my DBCP datasource so that I can see
> where the connection "userName" property gets trashed? I've tried
> putting org.apache.commons.dbcp in my log4j.properties, but do not
> seem to get any additional output. Once I can see if things are
> passed correctly here, I'll look at the MySQL Connector/J logging
> (although it is not obvious how to do this).
>
> Any suggestions?
>
> Thanks - Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org