Hi all, I'm also trying to get through the tutorial.
Can you post your Torque.properties file please? I also have the error about a null url. Had you any success with "ant -f build-torque.xml compile". javac does not find any class from the lib/*.jar-files. I also had to copy torque-3.1.jar to my torque-gen-3.1/lib directory. The tutorial is not really helpful. It looks very out-of-date. Thanks, Thomas On Monday 09 February 2004 23:44, Andrew Zahra wrote: > I found the tutorial similarly frustrating, but I did actually get a subset > of the tutorial going. I sucessfully created a book and publisher. > > I am using mysql and also get the transaction warning, but it still works. > > I had to manually execute the sql to pupulate the id broker table. If your > id broker table is empty, you will need to do that too. Although the > exception you are getting about a null url implies a config error - > somewhere. > > It would be really helpful if someone who was familiar with torque could > put together a working example to share and highlight the key configuration > items. > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, February 10, 2004 4:18 AM > Subject: The bookstore example > > > Hi all, > > > > I'm trying to learn Torque, but the more I try, the more frustrated > > I get :(. I've started with the bookstore example. Everything was > > going smoothly untill I tried to run the example. > > > > I'm getting an exception that starts as follows. > > > > <cut> > > [WARN] IDBroker - -IDBroker is being used with db 'bookstore', which > > does not support transactions. IDBroker attempts to use transactions > > to limit the possibility of duplicate key generation. Without > > transactions, duplicate key generation is possible if multiple JVMs > > are used or other means are used to write to the database. > > [DEBUG] Transaction - -called safeRollback with null argument > > java.sql.SQLException: The url cannot be null > > at java.sql.DriverManager.getConnection(DriverManager.java:489) > > at java.sql.DriverManager.getConnection(DriverManager.java:171) > > at > > org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnection(D >r iverAdapterCPDS.java:205) > > > at > > org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnection(D >r iverAdapterCPDS.java:175) > > > at > > org.apache.commons.dbcp.datasources.InstanceKeyDataSource.testCPDS(Instance >K eyDataSource.java:753) > > > at > > org.apache.commons.dbcp.datasources.SharedPoolDataSource.registerPool(Share >d PoolDataSource.java:234) > > > at > > org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectio >n AndInfo(SharedPoolDataSource.java:203) > > > at > > org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(Ins >t anceKeyDataSource.java:681) > > > at > > org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(Ins >t anceKeyDataSource.java:665) > > > at > > org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:743) > > 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.hicnar.db.BasePublisher.save(BasePublisher.java:484) > > at com.hicnar.db.BasePublisher.save(BasePublisher.java:465) > > at com.hicnar.runtime.TestIt.main(TestIt.java:27) > > rethrown as org.apache.torque.TorqueException: The url cannot be null > > at > > org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:755) > > 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.hicnar.db.BasePublisher.save(BasePublisher.java:484) > > at com.hicnar.db.BasePublisher.save(BasePublisher.java:465) > > at com.hicnar.runtime.TestIt.main(TestIt.java:27) > > Caused by: java.sql.SQLException: The url cannot be null > > at java.sql.DriverManager.getConnection(DriverManager.java:489) > > at java.sql.DriverManager.getConnection(DriverManager.java:171) > > at > > org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnection(D >r iverAdapterCPDS.java:205) > > > at > > org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS.getPooledConnection(D >r iverAdapterCPDS.java:175) > > > at > > org.apache.commons.dbcp.datasources.InstanceKeyDataSource.testCPDS(Instance >K eyDataSource.java:753) > > > at > > org.apache.commons.dbcp.datasources.SharedPoolDataSource.registerPool(Share >d PoolDataSource.java:234) > > > at > > org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnectio >n AndInfo(SharedPoolDataSource.java:203) > > > at > > org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(Ins >t anceKeyDataSource.java:681) > > > at > > org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(Ins >t anceKeyDataSource.java:665) > > > at > > org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:743) > > ... 6 more > > > > I use PostgreSQL 7.3 on Fedora Core 1. The JDK is 1.4_02. > > AFAIK PostgreSQL supports transactions, so what does the line > > "[WARN] IDBroker - -IDBroker is being used with db 'bookstore', > > which does not support transactions." mean?? Have I misconfigured > > anything?? > > > > Do you know anybody who succeeded running the example armed only > > with the knowledge from > > http://db.apache.org/torque/tutorial/index.html ?? > > > > For instance.. the Torque.properties init lines taken from the > > tutorial page should be like these: > > > > 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/bookstore > > torque.database.bookstore.username = user > > torque.database.bookstore.password = password > > > > and there's nothing about the params for dsfactory!!?? > > > > Fortunately Göschl Siegfried mentioned this in his post at > > http://www.mail-archive.com/[EMAIL PROTECTED]/msg01869.html > > helping me to go one step forward. > > > > My "Torque.properties" looks like follows > > > > 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.adapter=postgresql > > > > torque.dsfactory.bookstore.factory= > > org.apache.torque.dsfactory.SharedPoolDataSourceFactory > > torque.dsfactory.bookstore.pool.defaultMaxConnections=10 > > torque.dsfactory.bookstore.pool.maxExpiryTime=3600 > > torque.dsfactory.bookstore.pool.connectionWaitTimeout=10 > > torque.dsfactory.bookstore.pool.testOnBorrow=true > > > > torque.database.bookstore.driver = org.postgresql.Driver > > torque.database.bookstore.url = jdbc:postgresql://127.0.0.1/bookstore > > torque.database.bookstore.username = hicnar > > torque.database.bookstore.password = mypass > > > > I'll be gratefull for any suggestions that might help me to run the > > example. > > > > Chris > > > > PS. In my oppinion such simple examples are intended for folks like > > me - who want a quick start in a new tech, but if they're incomplete > > or not working... well that's the best way to bias a novice against > > even a very interesting piece of tech. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
