Hello.

In troubleshooting an error running the Torque tutorial demo, I have found a strange Torque behavior. On one of my test machines (which I'll call Server A), the bookstore demo runtime throws a SQLException error because of a null connection object. On a second test machine (Server B), the bookstore demo runs fine. From examining the debugger output, I think that the error is caused by AbstractDataSourceFactory somehow not invoking ConvertUtils before attempting to set properties on DriverAdapterCPDS. Can anyone tell me why this is happening or at least give me pointers on troubleshooting the problem?

My first impression was to verify the versions on all the Torque jar dependencies. I verified that the problem occurs on Server A even when it has identical jars to Server B. Server A has Tomcat4 and Resin 4.0 installed on it while Server B does not, however. Is there a possibility that there's a stray jar somewhere on Server A that's causing the error? What jar might be causing the problem?

A lot of questions, I know, but I'm really stumped on this one since I'm just learning Torque.

Pasted below is relevant excerpts from the debugger output from runs of the bookstore on Server A and Server B.

<Server A (system that has Torque errors) debugger output>
[DEBUG] AbstractDataSourceFactory - - applyConfiguration([EMAIL PROTECTED] a3a70, [EMAIL PROTECTED])
[ERROR] AbstractDataSourceFactory - -Property: driver value: com.mysql.jdbc.Driver is not supported by DataSource: org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[ERROR] AbstractDataSourceFactory - -Property: url value: jdbc:mysql://127.0.0.1:3306/bookstore is not supported by DataSource: org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[ERROR] AbstractDataSourceFactory - -Property: user value: robertmpratt is not supported by DataSource: org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[ERROR] AbstractDataSourceFactory - -Property: password value: b737-700 is not supported by DataSource: org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[DEBUG] SharedPoolDataSourceFactory - -Starting initJdbc2Pool
[DEBUG] TorqueInstance - -getConfiguration() = [EMAIL PROTECTED]
[DEBUG] AbstractDataSourceFactory - -applyConfiguration(null, [EMAIL PROTECTED])
[DEBUG] AbstractDataSourceFactory - - applyConfiguration([EMAIL PROTECTED] 3ef10, [EMAIL PROTECTED])
[ERROR] AbstractDataSourceFactory - -Property: defaultMaxActive value: 30 is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[DEBUG] ConvertUtils - -Convert string 'true' to class 'boolean'
[ERROR] AbstractDataSourceFactory - -Property: testOnBorrow value: true is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[DEBUG] ConvertUtils - -Convert string 'SELECT 1' to class 'java.lang.String'
[ERROR] AbstractDataSourceFactory - -Property: validationQuery value: SELECT 1 is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[DEBUG] TorqueInstance - -Adding a dummy entry for default, mapped onto bookstore
[DEBUG] TorqueInstance - -getConfiguration() = [EMAIL PROTECTED]
</Server A debugger output>


<Server B (system that does not have Torque errors) debugger output>
[DEBUG] AbstractDataSourceFactory - - applyConfiguration([EMAIL PROTECTED] 0be38, [EMAIL PROTECTED])
[DEBUG] ConvertUtils - -Convert string 'com.mysql.jdbc.Driver' to class 'java.lang.String'
[DEBUG] AbstractDataSourceFactory - - setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@ c9ba38, driver, com.mysql.jdbc.Driver)
[DEBUG] ConvertUtils - -Convert string 'jdbc:mysql://127.0.0.1:3306/bookstore' to class 'java.lang.String'
[DEBUG] AbstractDataSourceFactory - - setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@ c9ba38, url, jdbc:mysql://127.0.0.1:3306/bookstore)
[DEBUG] ConvertUtils - -Convert string 'robertmpratt' to class 'java.lang.String'
[DEBUG] AbstractDataSourceFactory - - setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@ c9ba38, user, robertmpratt)
[DEBUG] ConvertUtils - -Convert string 'b737-700' to class 'java.lang.String'
[DEBUG] AbstractDataSourceFactory - - setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@ c9ba38, password, b737-700)
[DEBUG] SharedPoolDataSourceFactory - -Starting initJdbc2Pool
[DEBUG] TorqueInstance - -getConfiguration() = [EMAIL PROTECTED]
[DEBUG] AbstractDataSourceFactory - -applyConfiguration(null, [EMAIL PROTECTED])
[DEBUG] AbstractDataSourceFactory - - applyConfiguration([EMAIL PROTECTED] 08ca1, [EMAIL PROTECTED])
[ERROR] AbstractDataSourceFactory - -Property: defaultMaxActive value: 30 is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[DEBUG] ConvertUtils - -Convert string 'true' to class 'boolean'
[ERROR] AbstractDataSourceFactory - -Property: testOnBorrow value: true is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[DEBUG] ConvertUtils - -Convert string 'SELECT 1' to class 'java.lang.String'
[ERROR] AbstractDataSourceFactory - -Property: validationQuery value: SELECT 1 is not supported by DataSource: org.apache.commons.dbcp.datasources.SharedPoolDataSource
[DEBUG] TorqueInstance - -Adding a dummy entry for default, mapped onto bookstore
[DEBUG] TorqueInstance - -getConfiguration() = [EMAIL PROTECTED]
</Server B debugger output>


Notice that Server B invokes ConvertUtils (which I have found is from the commons-beanutils package) before AbstractDataSourceFactory sets properties while Server A does not.

Any feedback to this help request would be greatly appreciated.


Sincerely, Rob Pratt [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to