Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 30861 invoked from network); 27 Oct 2003 00:12:09 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Oct 2003 00:12:09 -0000 Received: (qmail 27578 invoked by uid 500); 27 Oct 2003 00:11:53 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 27397 invoked by uid 500); 27 Oct 2003 00:11:52 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 27384 invoked from network); 27 Oct 2003 00:11:51 -0000 Received: from unknown (HELO mta09ps.bigpond.com) (144.135.25.173) by daedalus.apache.org with SMTP; 27 Oct 2003 00:11:51 -0000 Received: from peoplelogic.com.au ([144.135.25.91]) by mta09ps.email.bigpond.com (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HNE006HG2A211@mta09ps.email.bigpond.com> for torque-user@db.apache.org; Mon, 27 Oct 2003 09:51:39 +1000 (EST) Received: from cpe-203-51-115-113.nsw.bigpond.net.au ([203.51.115.113]) by psmam08.mailsvc.email.bigpond.com(MAM REL_3_3_2c 153/1815914); Mon, 27 Oct 2003 09:51:38 +0000 Date: Mon, 27 Oct 2003 10:53:07 +0800 From: Sergey Moiseyev Subject: Re: java.lang.NullPointerException: There was no DataSourceFactory configured for the connection bookstore In-reply-to: <002d01c39c02$0e023840$6401a8c0@dell> To: Apache Torque Users List Message-id: <3F9C8893.3020009@peoplelogic.com.au> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030827 References: <002d01c39c02$0e023840$6401a8c0@dell> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi David Try to add the following lines to your property file: torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory torque.dsfactory.bookstore.pool.defaultMaxConnections=10 torque.dsfactory.bookstore.pool.maxExpiryTime=3600 torque.dsfactory.bookstore.pool.connectionWaitTimeout=10 torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver torque.dsfactory.bookstore.connection.url = jdbc:mysql://127.0.0.1/bookstore torque.dsfactory.bookstore.connection.user = torque.dsfactory.bookstore.connection.password = This is taken from the Torque.properties file which is located int the root directory of the torque-3.1 distribution. Cheers, Sergey David Chelimsky wrote: >Hi. I believe that I'm following the tutorial (http://db.apache.org/torque/tutorial) to the letter, but when I get to executing the Bookstore program (java com.kazmier.Bookstore), I get the following message: > >java.lang.NullPointerException: There was no DataSourceFactory configured for the connection bookstore > at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:749) > at org.apache.torque.Torque.getConnection(Torque.java:306) > at org.apache.torque.util.Transaction.beginOptional(Transaction.java:118) > at org.apache.torque.util.Transaction.begin(Transaction.java:100) > at com.kazmier.om.BasePublisher.save(BasePublisher.java:490) > at com.kazmier.om.BasePublisher.save(BasePublisher.java:471) > at com.kazmier.Bookstore.main(Bookstore.java:26) > >Note that at this point, I can see that the object model and various sql files are correctly created AND I can see that the database and relevant tables have been created. So I think that something is working at build time that is failing at run time. > >Here's build.properties: >======================================================== >torque.jar = torque-3.1.jar >torque.project = bookstore >torque.database = mysql >torque.targetPackage = com.kazmier.om >torque.database.createUrl = jdbc:mysql://127.0.0.1:3306/mysql >torque.database.buildUrl = jdbc:mysql://127.0.0.1:3306/bookstore >torque.database.url = jdbc:mysql://127.0.0.1:3306/bookstore >torque.database.driver = org.gjt.mm.mysql.Driver >torque.database.user = >torque.database.password = >torque.database.host = 127.0.0.1 >======================================================== > >And here's 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 = bookstore >torque.database.bookstore.driver = org.gjt.mm.mysql.Driver >torque.database.bookstore.url = jdbc:mysql://127.0.0.1:3306/bookstore >torque.database.bookstore.username = >torque.database.bookstore.password = >======================================================== > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org