db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu DELAHAIS <dela_...@yahoo.fr>
Subject Problem with torque.init
Date Wed, 30 Apr 2003 15:15:00 GMT
Hi,

I'm trying to use torque. So, I created the object
model corresponding to my database. Then, I created my
torque.properties file as follow :

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 = cms
torque.database.cms.adapter = mssql
torque.dsfactory.cms.factory =
org.apache.torque.dsfactory.TorqueDataSourceFactory
torque.dsfactory.cms.pool.defaultMaxConnections=10
torque.dsfactory.cms.pool.maxExpiryTime=3600
torque.dsfactory.cms.pool.connectionWaitTimeout=10
torque.dsfactory.cms.driver =
com.microsoft.jdbc.sqlserver.SQLServerDriver
torque.dsfactory.cms.url =
jdbc:microsoft:sqlserver://localhost:1433;dsfactoryname=cms;SelectMethod=cursor
torque.dsfactory.cms.username = username
torque.dsfactory.cms.password = password

torque.idbroker.cleverquantity = true
torque.manager.useCache = true

Then, I try to make a tes with a small program :
	public static void main(String[] args) 
	{
	Criteria lecritere = new Criteria();
	lecritere.add(ElementPeer.IDENT,"1");
	List lesElements;
	try
	{
	Torque.init("c:\\Torque.properties");
	System.out.println("init ok");
	lesElements = ElementPeer.doSelect(lecritere);
	System.out.println("Liste size = " +
lesElements.size());
	}
	catch (Exception e)
	{
	System.out.println("Erreur e = " + e);
	}
}

The problem is that my program didn't make the
torque.init... I trace the program and I found the
problem was in the class TorqueDataSourceFactory on
the method ConnectionPoolDataSource
initCPDS(Configuration configuration). The problem is
that the line :
Configuration c = configuration.subset("connection");
return null (c = null);
Any idea will be very welcome!
Thanks in advance 

Matthieu


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran├žais !
Yahoo! Mail : http://fr.mail.yahoo.com

Mime
View raw message