You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by stewart titan <st...@yahoo.co.uk> on 2002/01/24 15:07:10 UTC
Connecting to Postgres with Torque v3
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Connecting to Postgres with Torque v3
Posted by Pete Kazmier <pe...@kazmier.com>.
On Thu, Jan 24, 2002 at 02:07:10PM +0000, stewart titan wrote:
> 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?
What version of Torque are you using? If you are using the standalone
(which is what the tutorial is for), then your run-time properties file
should have properties in the form of:
torque.database.*
If you are using the Torque that is coupled with Turbine, your run-time
propertise file should have properties in the form of:
services.DatabaseService.*
Again, the offer still stands, if you send me (to my email address) the
following:
- build.properties
- the contents of your schema directory
- Torque.properties (the run-time properties)
I'd be happy to look at this in more detail for you. I ran across the
same problem with my first app and it turned out to be something very
small (although I can't recall at the moment).
Thanks,
Pete
--
Peter Kazmier http://www.kazmier.com
PGP Fingerprint 4FE7 8DA3 D0B5 9CAA 69DC 7243 1855 BC2E 4B43 5654
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>