db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branden Root <bran...@portentinteractive.com>
Subject Torque problems with Tomcat and Struts
Date Fri, 14 Nov 2003 19:31:53 GMT
Hello,


	I've been trying to get Torque standalone to work with a Tomcat/Struts 
webapp. When I follow the tutorial to create a standalone test, all works 
well, from OM generation to the actual database work. However, when I copy my 
classes over to my webapp and try and do the same thing, I get errors. I 
created a small servlet to run Torque.init("/path/to/Torque.properties") and 
I watch the tomcat log to see the error. If anyone could let me know what I'm 
doing wrong I'd greatly appreciate it.

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.database.default= gamehosting
torque.database.gamehosting.driver = 
com.microsoft.jdbc.sqlserver.SQLServerDriver
torque.database.gamehosting.url = jdbc:microsoft:sqlserver://
dbserver:1433;DatabaseName=gamehosting;SelectMethod=cursor

torque.database.gamehosting.username = username
torque.database.gamehosting.password = password
torque.dsfactory.gamehosting.factory = 
org.apache.torque.dsfactory.TorqueDataSourceFactory

torque.dsfactory.gamehosting.pool.defaultMaxConnections=10
torque.dsfactory.gamehosting.pool.maxExpiryTime=3600
torque.dsfactory.gamehosting.pool.connectionWaitTimeout=10
torque.dsfactory.gamehosting.connection.driver = 
com.microsoft.jdbc.sqlserver.SQLServerDriver
torque.dsfactory.gamehosting.connection.url = jdbc:microsoft:sqlserver://
dbserver:1433;DatabaseName=gamehosting;SelectMethod=cursor
torque.dsfactory.gamehosting.connection.user = username
torque.dsfactory.gamehosting.connection.password = password
torque.database.gamehosting.adapter = mssql
torque.gamehosting.connection.driver   = 
com.microsoft.jdbc.sqlserver.SQLServerDriver

Here's the error message in catalina.out when i run the servlet that contains 
Torque.init(). Note, the servlet actually runs fine, even though the log says 
ERROR. Its only when I try and actually do a database operation, like 
myclass.save() that i get an actual exception.

[DEBUG] TorqueInstance - -initialize()
[DEBUG] TorqueInstance - 
-setConfiguration(org.apache.commons.configuration.BaseConfiguration@1257687)
[DEBUG] TorqueInstance - 
-initAdapters(org.apache.commons.configuration.BaseConfiguration@1257687)
[DEBUG] TorqueInstance - -Adding mssql -> gamehosting as Adapter
[DEBUG] TorqueInstance - 
-initDataSourceFactories(org.apache.commons.configuration.BaseConfiguration@1257687)
[DEBUG] TorqueInstance - -handle: gamehosting DataSourceFactory: 
org.apache.torque.dsfactory.TorqueDataSourceFactory
[DEBUG] AbstractDataSourceFactory - -Starting initCPDS
[DEBUG] TorqueInstance - -getConfiguration() = 
org.apache.commons.configuration.BaseConfiguration@1257687
[DEBUG] AbstractDataSourceFactory - -applyConfiguration(null, 
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@88d319)
[DEBUG] AbstractDataSourceFactory - 
-applyConfiguration(org.apache.commons.configuration.BaseConfiguration@db38a4, 
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@88d319)
[DEBUG] ConvertUtils - -Convert string 'mssql' to class 'java.lang.String'
[ERROR] AbstractDataSourceFactory - -Property: driver value: 
com.microsoft.jdbc.sqlserver.SQLServerDriver is not supported by DataSource: 
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
[DEBUG] ConvertUtils - -Convert string 
'jdbc:microsoft:sqlserver://192.168.1.15:1433;DatabaseName=gamehosting;SelectMethod=cursor'

to class 'java.lang.String'
[DEBUG] AbstractDataSourceFactory - 
-setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS@88d319, 
url, 
jdbc:microsoft:sqlserver://192.168.1.15:1433;DatabaseName=gamehosting;SelectMethod=cursor)

And when i actually try and do a database operation i get:


java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getConnection(DriverManager.java:532)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at 
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnection(DriverAdapterCPDS.java:205)
        at 
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnection(DriverAdapterCPDS.java:175)
        at 
org.apache.torque.pool.ConnectionPool.getNewConnection(ConnectionPool.java:254)


No matter what I put for the torque.dsfactory.gamehosting.connection.driver, I 
seem to get the same error in the logs.


Any ideas?



-- 
Branden Root
Senior Developer
Portent Interactive

If you wish to learn more about the security features of
this email, and how it can help your business, please email 
branden@portentinteractive.com


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message