Hi

I've looked at the torque toturial, and copied and
pasted the run time *.properties file:

I've copied the postgres.jar to Torque/lib directory.

When I run my app -  which is largly the same as the
tutorial example, I get the following exception

connection = null

/usr/local/development/jbuilder4/jdk1.3/bin/java
-classpath
"/home/stewart/files/development/java/torquetest/classes:/usr/share/pgsql/jdbc7.0-1.2.jar:/home/stewart/files/development/java/torquetest/torque/lib/commons-collections.jar:/home/stewart/files/development/java/torquetest/torque/lib/commons-util-0.1-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/jdbc2_0-stdext.jar:/home/stewart/files/development/java/torquetest/torque/lib/log4j-1.1.3.jar:/home/stewart/files/development/java/torquetest/torque/lib/torque-3.0-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/velocity-1.3-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/village-1.5.3-dev.jar:/home/stewart/files/development/java/torquetest/torque/lib/xerces-1.4.4.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/sunrsasign.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/rt.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/i18n.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/javaplugin.jar:/usr/local/development/jbuilder4/jdk1.3/jre/lib/javaplugin_l10n.jar:/usr/local/development/jbuilder4/jdk1.3/lib/tools.jar:/usr/local/development/jbuilder4/jdk1.3/lib/dt.jar:/usr/local/development/jbuilder4/jdk1.3/demo/jfc/Java2D/Java2Demo.jar"
 org.stewarthector.TorqueTest.tester 
 connectin = null
java.lang.NullPointerException
        at
org.apache.torque.util.BasePeer.rollBackTransaction(BasePeer.java:375)
        at
org.stewarthector.TorqueTest.Entity.BaseApplication.save(BaseApplication.java:306)
        at
org.stewarthector.TorqueTest.Entity.BaseApplication.save(BaseApplication.java:285)
        at
org.stewarthector.TorqueTest.tester.doStuff(tester.java:37)
        at
org.stewarthector.TorqueTest.tester.main(tester.java:20)


It throws the exception on the dbCon = ... line
    public void save(String dbName) throws Exception
    {
        DBConnection dbCon = null;
         try
        {
            dbCon = BasePeer.beginTransaction(dbName);
            save(dbCon);
        }
        catch(Exception e)
        {
            BasePeer.rollBackTransaction(dbCon);
            throw e;
        }
        BasePeer.commitTransaction(dbCon);



Also I'm wondering why the tutorial gives the example
of:
services.DatabaseService.bah.bah
while the ??.properties config gives:

torque.database..bah.bah

Whats the difference?


Below are the settings I've changed in the
?.properties file:

services.DatabaseService.database.default=default

services.DatabaseService.database.default.driver=org.postgresql.Driver
services.DatabaseService.database.default.url=jdbc:postgresql://server/apps
services.DatabaseService.database.default.username=stewart
# These are the supported JDBC drivers and their
associated Turbine
# adapter.  These properties are used by the
DBFactory.  You can add
# all the drivers you want here.

services.DatabaseService.database.adapter=DBMM
services.DatabaseService.database.adapter.DBMM=org.postgresql.Driver


services.DatabaseService.database.idbroker.prefetch=true

services.DatabaseService.earlyInit = true

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to