db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Pratt <rpr...@wordandsound.com>
Subject SQLException in Tutorial Runtime
Date Tue, 30 Dec 2003 05:33:23 GMT
Hello.

To learn Torque, I went through the tutorial, and I'm getting an error  
at the final step that I can't seem to fix. I'm trying to run Torque on  
RedHat Linux 9.0-Plesk 6.0 with J2SDK 1.4.2 and MySQL 3.23. I get a  
SQLException that looks like it's resulting from Torque.init() not  
reading my Torque.properties file correctly. A funny thing is that even  
though the SQLException says it can't connect to the db, the "ant -f  
build-torque.xml create-db" and table-init steps work fine. I get a  
similar SQLException when running Torque programmatically from a test  
webapp running under Resin 4.0. Have I forgotten to configure something  
or to install a critical jar?

Pasted below are the debug output from the "java com.kazmier.Bookstore"  
command at the end of the tutorial and my Torque.properties file (which  
resides at the top level of my torque-tutorial directory hierarchy).  
Can a Torque guru or someone who's had a similar problem or someone who  
has an idea about what to try next respond with some troubleshooting  
ideas?

So far I've tried ...
* (Of course) Backtracking all my work on the tutorial to make sure I  
didn't have any typos, etc. (which isn't to say that I'm 100-percent  
sure my configs are typo-free)
* Swapping localhost/127.0.0.1 in the db url
* Trying a couple of different admin-level db users
* Tweaking the Torque.properties file to use  
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
* Uncommenting the "tableType = MyISAM" line in  
templates/sql/base/mysql/db.props file

My next step would be to try to suss out whether some of my jars were  
old/bad versions ... but I just don't know Torque that well to be able  
to tell. Any help would be greatly appreciated!

Sincerely,
Rob Pratt
rpratt@wordandsound.com

<runtime output>
[DEBUG] TorqueInstance - -init(Torque.properties)
[DEBUG] TorqueInstance - -Config Object is  
org.apache.commons.configuration.PropertiesConfiguration@8379988
[DEBUG] TorqueInstance -  
-init(org.apache.commons.configuration.PropertiesConfiguration@8379988)
[DEBUG] TorqueInstance -  
- 
setConfiguration(org.apache.commons.configuration.PropertiesConfiguratio 
n@8379988)
[DEBUG] TorqueInstance - -initialize()
[DEBUG] TorqueInstance -  
- 
setConfiguration(org.apache.commons.configuration.BaseConfiguration@82ba 
050)
[DEBUG] TorqueInstance -  
- 
initAdapters(org.apache.commons.configuration.BaseConfiguration@82ba050)
[WARN] TorqueInstance - -No Database definitions found!
[DEBUG] TorqueInstance -  
- 
initDataSourceFactories(org.apache.commons.configuration.BaseConfigurati 
on@82ba050)
[DEBUG] TorqueInstance - -handle: bookstore DataSourceFactory:  
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
[DEBUG] AbstractDataSourceFactory - -Starting initCPDS
[DEBUG] TorqueInstance - -getConfiguration() =  
org.apache.commons.configuration.BaseConfiguration@82ba050
[DEBUG] AbstractDataSourceFactory - -applyConfiguration(null,  
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@82b3200)
[DEBUG] AbstractDataSourceFactory -  
- 
applyConfiguration(org.apache.commons.configuration.BaseConfiguration@84 
b1db0, org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@82b3200)
[ERROR] AbstractDataSourceFactory - -Property: driver value:  
org.gjt.mm.mysql.Driver is not supported by DataSource:  
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[ERROR] AbstractDataSourceFactory - -Property: url value:  
jdbc:mysql://localhost:3306/bookstore is not supported by DataSource:  
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[ERROR] AbstractDataSourceFactory - -Property: username value: wssib is  
not supported by DataSource:  
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[ERROR] AbstractDataSourceFactory - -Property: password value: 6rjr1rj(  
is not supported by DataSource:  
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[DEBUG] SharedPoolDataSourceFactory - -Starting initJdbc2Pool
[DEBUG] TorqueInstance - -getConfiguration() =  
org.apache.commons.configuration.BaseConfiguration@82ba050
[DEBUG] AbstractDataSourceFactory - -applyConfiguration(null,  
org.apache.commons.dbcp.datasources.SharedPoolDataSource@8512a80)
[DEBUG] AbstractDataSourceFactory -  
- 
applyConfiguration(org.apache.commons.configuration.BaseConfiguration@82 
e9a30, org.apache.commons.dbcp.datasources.SharedPoolDataSource@8512a80)
[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 - -getConfiguration() =  
org.apache.commons.configuration.BaseConfiguration@82ba050
[DEBUG] IDBroker - -IDBroker thread was started.
[WARN] IDBroker - -IDBroker is being used with db 'bookstore', which  
does not support transactions. IDBroker attempts to use transactions to  
limit the possibility of duplicate key generation.  Without  
transactions, duplicate key generation is possible if multiple JVMs are  
used or other means are used to write to the database.
[DEBUG] Transaction - -called safeRollback with null argument
java.sql.SQLException: Driver not found for URL: null
    at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String)  
(/usr/lib/./libgcj.so.3)
    at 0x4025bcd2: java.lang.Exception.Exception(java.lang.String)  
(/usr/lib/./libgcj.so.3)
    at 0x402fce64: java.sql.SQLException.SQLException(java.lang.String,  
java.lang.String, int) (/usr/lib/./libgcj.so.3)
    at 0x402fce14: java.sql.SQLException.SQLException(java.lang.String)  
(/usr/lib/./libgcj.so.3)
    at 0x402fccd2:  
java.sql.DriverManager.getConnection(java.lang.String,  
java.util.Properties) (/usr/lib/./libgcj.so.3)
    at 0x402fcc0e:  
java.sql.DriverManager.getConnection(java.lang.String,  
java.lang.String, java.lang.String) (/usr/lib/./libgcj.so.3)

-- SNIP: More stack trace available if it may prove useful --

</runtime output>

<Torque.properties>
log4j.rootCategory = DEBUG, default
log4j.appender.default = org.apache.log4j.FileAppender
log4j.appender.default.file = ./torque.log
log4j.appender.default.layout = org.apache.log4j.SimpleLayout

torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.SharedPoo 
lDataSourceFactory
torque.dsfactory.bookstore.pool.defaultMaxActive=30
torque.dsfactory.bookstore.pool.testOnBorrow=true
torque.dsfactory.bookstore.pool.validationQuery=SELECT 1
torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.bookstore.connection.url =  
jdbc:mysql://localhost:3306/bookstore
torque.dsfactory.bookstore.connection.username = wssib
torque.dsfactory.bookstore.connection.password = 6rjr1rj(
</Torque.properties>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message