You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Branden Root <br...@portentinteractive.com> on 2003/11/14 20:31:53 UTC

Torque problems with Tomcat and Struts

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


Re: Torque problems with Tomcat and Struts - POTENTIAL SPAM

Posted by Branden Root <br...@portentinteractive.com>.
Dave,

	I have the mssql driver jars in the WEB-INF/lib directory, and I can 
do simple JDBC.
[ERROR] AbstractDataSourceFactory - -Property: driver value:
com.microsoft.jdbc.sqlserver.SQLServerDriver is not supported by 
DataSource:
org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS

It just seems like I'm doing something wrong with this. However, its 
very confusing because the same Torque.properties file is being used 
when I use Torque standalone and that runs fine. Only in the webapp 
does it break.


Branden Root
Senior Developer
Portent Interactive
On Nov 14, 2003, at 11:44 AM, Dave Newton wrote:

> On Fri, 2003-11-14 at 14:31, Branden Root wrote:
>> [... lots of stuff ...]
>
> Is the driver in the appropriate directory? It just seems like it isn't
> being found. Can you do simple JDBC from a servlet? It might be easier
> to track down the driver issue that way than wading through Torque.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Re: Torque problems with Tomcat and Struts

Posted by Dave Newton <da...@solaraccess.com>.
On Fri, 2003-11-14 at 14:31, Branden Root wrote:
> [... lots of stuff ...]

Is the driver in the appropriate directory? It just seems like it isn't
being found. Can you do simple JDBC from a servlet? It might be easier
to track down the driver issue that way than wading through Torque.

Dave



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


Re: Torque problems with Tomcat and Struts

Posted by Branden Root <br...@portentinteractive.com>.
Michael,


	I checked and I don't have any duplicate jars. The standalone version 
of Torque that I'm using does apparently have OLDER jars. Here's the 
list of jars in tomcat's common/lib
activation.jar                          jdbc2_0-stdext.jar
ant.jar                                 jndi.jar
commons-collections.jar                 jta.jar
commons-dbcp-1.1.jar        mail.jar
commons-logging-api.jar                 naming-common.jar
commons-pool-1.1.jar        naming-factory.jar
jasper-compiler.jar                     naming-resources.jar
jasper-runtime.jar                      servlet.jar

In my webdir's WEB-INF/lib:
ant-1.5.1.jar
avalon-framework-4.1.4.jar
commons-beanutils-1.6.1.jar
commons-collections-2.1.jar
commons-configuration-1.0-dev-3.20030607.194155.jar
commons-digester.jar
commons-fileupload.jar
commons-lang.jar
commons-logging.jar
commons-validator.jar
jakarta-oro.jar
jcs-20030822.182132.jar
jdbc-2.0.jar
jndi-1.2.1.jar
junit-3.8.1.jar
log4j-1.2.8.jar
logkit-1.0.1.jar
msbase.jar
mssqlserver.jar
msutil.jar
stratum-1.0-b3.jar
struts.jar
torque-3.1.jar
torque-gen-3.1.jar
velocity-1.3.1.jar
velocity-tools-1.1-dev.jar
velocity-tools-view-1.1-dev.jar
village-2.0-dev-20030825.jar
xercesImpl-2.0.2.jar
xmlParserAPIs-2.0.2.jar


Thanks again for the help.



Branden Root
Senior Developer
Portent Interactive
On Nov 14, 2003, at 2:30 PM, Michael Della Bitta wrote:
>


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


Re: Torque problems with Tomcat and Struts

Posted by Michael Della Bitta <md...@earthlink.net>.
do you have another version of commons-dbcp.jar in your global lib  
directory for your servlet container? or other duplicate jars?

Michael Della Bitta

On Nov 14, 2003, at 3:54 PM, Branden Root wrote:

>
> 	
> 	I get the same problem if i try using SharedPoolDataSourceFactory.  
> The logs do show the change in the factory, but other than that exact  
> same error.
>
>
> Branden Root
> Senior Developer
> Portent Interactive
> On Nov 14, 2003, at 12:48 PM, Derick Fernando wrote:
>
>> Hi,
>>
>> Looked in CVS, apparently its been replaced:
>> http://cvs.apache.org/viewcvs/db-torque/src/java/org/apache/torque/ 
>> dsfactory/
>>
>> Derick
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Re: Torque problems with Tomcat and Struts

Posted by Branden Root <br...@portentinteractive.com>.
	
	I get the same problem if i try using SharedPoolDataSourceFactory. The  
logs do show the change in the factory, but other than that exact same  
error.


Branden Root
Senior Developer
Portent Interactive
On Nov 14, 2003, at 12:48 PM, Derick Fernando wrote:

> Hi,
>
> Looked in CVS, apparently its been replaced:
> http://cvs.apache.org/viewcvs/db-torque/src/java/org/apache/torque/ 
> dsfactory/
>
> Derick


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


Re: Torque problems with Tomcat and Struts

Posted by Derick Fernando <de...@tarausa.com>.
Hi,

Looked in CVS, apparently its been replaced:
http://cvs.apache.org/viewcvs/db-torque/src/java/org/apache/torque/dsfactory/

Derick

----- Original Message ----- 
From: "Branden Root" <br...@portentinteractive.com>
To: "Apache Torque Users List" <to...@db.apache.org>
Sent: Friday, November 14, 2003 12:40 PM
Subject: Re: Torque problems with Tomcat and Struts


> Derick,
>
> If I try using that I get a java.lang.ClassNotFoundException:
> org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory. Could this hint
> at whats going on?
>
> Branden Root
> Senior Developer
> Portent Interactive
> On Nov 14, 2003, at 12:37 PM, Derick Fernando wrote:
>
> > Hi Again,
> >
> > Have you tried this factory as well?
> > org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory
> >
> > Derick
> >
> > ----- Original Message -----
> > From: "Branden Root" <br...@portentinteractive.com>
> > To: "Apache Torque Users List" <to...@db.apache.org>
> > Sent: Friday, November 14, 2003 12:27 PM
> > Subject: Re: Torque problems with Tomcat and Struts
> >
> >
> >> Derick,
> >>
> >> Still didn't do anything I'm afraid.
> >>
> >> Branden Root
> >> Senior Developer
> >> Portent Interactive
> >> On Nov 14, 2000, at 11:48 AM, Derick Fernando wrote:
> >>
> >>> Hello,
> >>>
> >>> Not sure if this is this issue, but try:
> >>> torque.dsfactory.default.factory=org.apache.torque.dsfactory.TorqueDa
> >>> ta
> >>> Sourc
> >>> eFactory
> >>>
> >>> Derick
> >>>
> >>> ----- Original Message -----
> >>> From: "Branden Root" <br...@portentinteractive.com>
> >>> To: <to...@db.apache.org>
> >>> Sent: Friday, November 14, 2003 11:31 AM
> >>> Subject: Torque problems with Tomcat and Struts
> >>>
> >>>
> >>> 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@
> >>> 12
> >>> 57687
> >>> )
> >>> [DEBUG] TorqueInstance -
> >>> -initAdapters(org.apache.commons.configuration.BaseConfiguration@1257
> >>> 68
> >>> 7)
> >>> [DEBUG] TorqueInstance - -Adding mssql -> gamehosting as Adapter
> >>> [DEBUG] TorqueInstance -
> >>> -initDataSourceFactories(org.apache.commons.configuration.BaseConfigu
> >>> ra
> >>> tion@
> >>> 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.BaseConfiguratio
> >>> n@
> >>> db38a
> >>> 4,
> >>> 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;Selec
> >>> tMethod=cursor'
> >>> to class 'java.lang.String'
> >>> [DEBUG] AbstractDataSourceFactory -
> >>> -setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterC
> >>> PD
> >>> S@88d
> >>> 319,
> >>> url,
> >>> jdbc:microsoft:sqlserver://192.168.1.15:1433;
> >>> DatabaseName=gamehosting;
> >>> Select
> >>> Method=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.getPooledConnec
> >>> ti
> >>> on(Dr
> >>> iverAdapterCPDS.java:205)
> >>>         at
> >>> org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnec
> >>> ti
> >>> on(Dr
> >>> iverAdapterCPDS.java:175)
> >>>         at
> >>> org.apache.torque.pool.ConnectionPool.getNewConnection(ConnectionPool
> >>> .j
> >>> ava:2
> >>> 54)
> >>>
> >>>
> >>> 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
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> >>> For additional commands, e-mail: torque-user-help@db.apache.org
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> >> For additional commands, e-mail: torque-user-help@db.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Re: Torque problems with Tomcat and Struts

Posted by Branden Root <br...@portentinteractive.com>.
Derick,

	If I try using that I get a java.lang.ClassNotFoundException:  
org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory. Could this hint  
at whats going on?

Branden Root
Senior Developer
Portent Interactive
On Nov 14, 2003, at 12:37 PM, Derick Fernando wrote:

> Hi Again,
>
> Have you tried this factory as well?
> org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory
>
> Derick
>
> ----- Original Message -----
> From: "Branden Root" <br...@portentinteractive.com>
> To: "Apache Torque Users List" <to...@db.apache.org>
> Sent: Friday, November 14, 2003 12:27 PM
> Subject: Re: Torque problems with Tomcat and Struts
>
>
>> Derick,
>>
>> Still didn't do anything I'm afraid.
>>
>> Branden Root
>> Senior Developer
>> Portent Interactive
>> On Nov 14, 2000, at 11:48 AM, Derick Fernando wrote:
>>
>>> Hello,
>>>
>>> Not sure if this is this issue, but try:
>>> torque.dsfactory.default.factory=org.apache.torque.dsfactory.TorqueDa 
>>> ta
>>> Sourc
>>> eFactory
>>>
>>> Derick
>>>
>>> ----- Original Message -----
>>> From: "Branden Root" <br...@portentinteractive.com>
>>> To: <to...@db.apache.org>
>>> Sent: Friday, November 14, 2003 11:31 AM
>>> Subject: Torque problems with Tomcat and Struts
>>>
>>>
>>> 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@ 
>>> 12
>>> 57687
>>> )
>>> [DEBUG] TorqueInstance -
>>> -initAdapters(org.apache.commons.configuration.BaseConfiguration@1257 
>>> 68
>>> 7)
>>> [DEBUG] TorqueInstance - -Adding mssql -> gamehosting as Adapter
>>> [DEBUG] TorqueInstance -
>>> -initDataSourceFactories(org.apache.commons.configuration.BaseConfigu 
>>> ra
>>> tion@
>>> 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.BaseConfiguratio 
>>> n@
>>> db38a
>>> 4,
>>> 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;Selec
>>> tMethod=cursor'
>>> to class 'java.lang.String'
>>> [DEBUG] AbstractDataSourceFactory -
>>> -setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterC 
>>> PD
>>> S@88d
>>> 319,
>>> url,
>>> jdbc:microsoft:sqlserver://192.168.1.15:1433; 
>>> DatabaseName=gamehosting;
>>> Select
>>> Method=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.getPooledConnec 
>>> ti
>>> on(Dr
>>> iverAdapterCPDS.java:205)
>>>         at
>>> org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnec 
>>> ti
>>> on(Dr
>>> iverAdapterCPDS.java:175)
>>>         at
>>> org.apache.torque.pool.ConnectionPool.getNewConnection(ConnectionPool 
>>> .j
>>> ava:2
>>> 54)
>>>
>>>
>>> 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
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: torque-user-help@db.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-user-help@db.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Re: Torque problems with Tomcat and Struts

Posted by Derick Fernando <de...@tarausa.com>.
Hi Again,

Have you tried this factory as well?
org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory

Derick

----- Original Message ----- 
From: "Branden Root" <br...@portentinteractive.com>
To: "Apache Torque Users List" <to...@db.apache.org>
Sent: Friday, November 14, 2003 12:27 PM
Subject: Re: Torque problems with Tomcat and Struts


> Derick,
>
> Still didn't do anything I'm afraid.
>
> Branden Root
> Senior Developer
> Portent Interactive
> On Nov 14, 2000, at 11:48 AM, Derick Fernando wrote:
>
> > Hello,
> >
> > Not sure if this is this issue, but try:
> > torque.dsfactory.default.factory=org.apache.torque.dsfactory.TorqueData
> > Sourc
> > eFactory
> >
> > Derick
> >
> > ----- Original Message -----
> > From: "Branden Root" <br...@portentinteractive.com>
> > To: <to...@db.apache.org>
> > Sent: Friday, November 14, 2003 11:31 AM
> > Subject: Torque problems with Tomcat and Struts
> >
> >
> > 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@12
> > 57687
> > )
> > [DEBUG] TorqueInstance -
> > -initAdapters(org.apache.commons.configuration.BaseConfiguration@125768
> > 7)
> > [DEBUG] TorqueInstance - -Adding mssql -> gamehosting as Adapter
> > [DEBUG] TorqueInstance -
> > -initDataSourceFactories(org.apache.commons.configuration.BaseConfigura
> > tion@
> > 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@
> > db38a
> > 4,
> > 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;Selec
> > tMethod=cursor'
> > to class 'java.lang.String'
> > [DEBUG] AbstractDataSourceFactory -
> > -setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPD
> > S@88d
> > 319,
> > url,
> > jdbc:microsoft:sqlserver://192.168.1.15:1433;DatabaseName=gamehosting;
> > Select
> > Method=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.getPooledConnecti
> > on(Dr
> > iverAdapterCPDS.java:205)
> >         at
> > org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnecti
> > on(Dr
> > iverAdapterCPDS.java:175)
> >         at
> > org.apache.torque.pool.ConnectionPool.getNewConnection(ConnectionPool.j
> > ava:2
> > 54)
> >
> >
> > 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
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Re: Torque problems with Tomcat and Struts

Posted by Branden Root <br...@portentinteractive.com>.
Derick,

	Still didn't do anything I'm afraid.

Branden Root
Senior Developer
Portent Interactive
On Nov 14, 2000, at 11:48 AM, Derick Fernando wrote:

> Hello,
>
> Not sure if this is this issue, but try:
> torque.dsfactory.default.factory=org.apache.torque.dsfactory.TorqueData 
> Sourc
> eFactory
>
> Derick
>
> ----- Original Message -----
> From: "Branden Root" <br...@portentinteractive.com>
> To: <to...@db.apache.org>
> Sent: Friday, November 14, 2003 11:31 AM
> Subject: Torque problems with Tomcat and Struts
>
>
> 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@12 
> 57687
> )
> [DEBUG] TorqueInstance -
> -initAdapters(org.apache.commons.configuration.BaseConfiguration@125768 
> 7)
> [DEBUG] TorqueInstance - -Adding mssql -> gamehosting as Adapter
> [DEBUG] TorqueInstance -
> -initDataSourceFactories(org.apache.commons.configuration.BaseConfigura 
> tion@
> 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@ 
> db38a
> 4,
> 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;Selec
> tMethod=cursor'
> to class 'java.lang.String'
> [DEBUG] AbstractDataSourceFactory -
> -setSimpleProperty(org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPD 
> S@88d
> 319,
> url,
> jdbc:microsoft:sqlserver://192.168.1.15:1433;DatabaseName=gamehosting; 
> Select
> Method=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.getPooledConnecti 
> on(Dr
> iverAdapterCPDS.java:205)
>         at
> org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnecti 
> on(Dr
> iverAdapterCPDS.java:175)
>         at
> org.apache.torque.pool.ConnectionPool.getNewConnection(ConnectionPool.j 
> ava:2
> 54)
>
>
> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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