db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Nguyen <franktngu...@sbcglobal.net>
Subject Re: No DataSourceFactory configured
Date Thu, 07 Feb 2008 02:44:49 GMT
Were you able to connect to any other database than "recoverable" database? what driver did
you use ? were you able to connect to recoverable database itself using JDBC test with the
same username and password? Lastly, try using different different dsfactory to see if it works
for you. Here is my sample setup with my youcaddy database. 

## Using commons-dbcp
torque.dsfactory.youcaddy.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
#torque.dsfactory.youcaddy.factory=org.apache.torque.dsfactory.PerUserPoolDataSourceFactor
y
torque.dsfactory.youcaddy.pool.defaultMaxActive=10
torque.dsfactory.youcaddy.pool.testOnBorrow=true
torque.dsfactory.youcaddy.pool.validationQuery=SELECT 1
torque.dsfactory.youcaddy.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.youcaddy.connection.url = jdbc:mysql://localhost/youcaddy
torque.dsfactory.youcaddy.connection.user = bla
torque.dsfactory.youcaddy.connection.password = bla

Good luck !

"Owen B. Mehegan" <omehegan@hi5.com> wrote: Hi, I've seen this question asked many times
in the mailing list 
archives, but so far I can't figure out a solution to the problem in my 
case. I have a unit test that is using Easymock to create mock database 
objects to test against. When I run the test, it always fails with this 
error:

java.lang.NullPointerException: There was no DataSourceFactory 
configured for the connection recoverable

But my Torque.properties _does_ include a datasource called 'recoverable:'

torque.dsfactory.recoverable.factory=com.friend.db.RecoverableDataSourceFactory
torque.dsfactory.recoverable.pool.maxActive=1
torque.dsfactory.recoverable.pool.maxIdle=1
torque.dsfactory.recoverable.pool.maxWait=1000
torque.dsfactory.recoverable.pool.testOnBorrow=false
torque.dsfactory.recoverable.pool.validationQuery=SELECT 1
torque.dsfactory.recoverable.connection.driver=com.mockrunner.mock.jdbc.MockDriver
torque.dsfactory.recoverable.connection.url = java://foo
torque.dsfactory.recoverable.connection.user = user
torque.dsfactory.recoverable.connection.password = foo

This entry is similar to others in the torque.properties, so I don't 
think the syntax is incorrect. What else could I be doing wrong?

-- 
Owen B. Mehegan
Database Framework QA Guy
"He is a dangerous mixture of sophistication and recklessness which
makes one anxious about his influence on other boys."

omehegan@hi5.com
YIM: omehegan
AIM: ottomaticjack
GTalk: omehegan@gmail.com

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



Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message