db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Chelimsky" <da...@chelimsky.org>
Subject Re: java.lang.NullPointerException: There was no DataSourceFactory configured for the connection bookstore
Date Sun, 26 Oct 2003 20:50:58 GMT
FYI - Here's the entire output - maybe something in here is helpful:

[DEBUG] TorqueInstance - -init(Torque.properties)
[DEBUG] TorqueInstance - -Config Object is
org.apache.commons.configuration.PropertiesConfiguration@fd13b5
[DEBUG]
TorqueInstance - -init(org.apache.commons.configuration.PropertiesConfigurat
ion@fd13b5)
[DEBUG]
TorqueInstance - -setConfiguration(org.apache.commons.configuration.Properti
esConfiguration@fd13b5)
[DEBUG] TorqueInstance - -initialize()
[DEBUG]
TorqueInstance - -setConfiguration(org.apache.commons.configuration.BaseConf
iguration@118f375)
[DEBUG]
TorqueInstance - -initAdapters(org.apache.commons.configuration.BaseConfigur
ation@118f375)
[WARN] TorqueInstance - -Databases defined but no adapter configurations
found!
[DEBUG]
TorqueInstance - -initDataSourceFactories(org.apache.commons.configuration.B
aseConfiguration@118f375)
[DEBUG] TorqueInstance - -Adding a dummy entry for default, mapped onto
bookstore
[DEBUG] TorqueInstance - -getConfiguration() =
org.apache.commons.configuration.BaseConfiguration@118f375
[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] IDBroker - -IDBroker thread was started.
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)

----- Original Message ----- 
From: "David Chelimsky" <david@chelimsky.org>
To: "Apache Torque Users List" <torque-user@db.apache.org>
Sent: Sunday, October 26, 2003 2:45 PM
Subject: java.lang.NullPointerException: There was no DataSourceFactory
configured for the connection bookstore


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


Mime
View raw message