db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jenny Brown <je...@bigbrother.net>
Subject Re: problem configuring data source
Date Thu, 03 Apr 2003 18:14:08 GMT
Correction, I got the data source working.  The solution is to provide keys for
dsfactory which are named 'default' instead of named after my project.

Correct keys:

torque.dsfactory.default.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory

torque.dsfactory.default.pool.defaultMaxConnections=10
torque.dsfactory.default.pool.maxExpiryTime=3600
torque.dsfactory.default.pool.connectionWaitTimeout=10

torque.dsfactory.default.connection.driver = org.postgresql.Driver
torque.dsfactory.default.connection.url = jdbc:postgresql://host:5432/database
torque.dsfactory.default.connection.user = username
torque.dsfactory.default.connection.password = password


Incorrect keys:

torque.dsfactory.myproject.pool.defaultMaxConnections=10
torque.dsfactory.myproject.pool.maxExpiryTime=3600
torque.dsfactory.myproject.pool.connectionWaitTimeout=10

torque.dsfactory.myproject.connection.driver = org.postgresql.Driver
torque.dsfactory.myproject.connection.url = jdbc:postgresql://host:5432/database
torque.dsfactory.myproject.connection.user = username
torque.dsfactory.myproject.connection.password = password




On Thu, 3 Apr 2003, Jenny Brown wrote:

> I'm using Torque stand-alone, and am having trouble getting the
> data source factory configuration set up right.  Here's what I'm
> seeing:
>
> DEBUG Thread-22 org.apache.torque.Torque (Torque.java:318) - handle:
>  defaults DataSourceFactory: org.apache.torque.dsfactory.TorqueDataSourceFactory
> DEBUG Thread-22 org.apache.torque.dsfactory.TorqueDataSourceFactory
>   (TorqueDataSourceFactory.java:124) - Starting initCPDS
>
> ERROR Thread-22 org.apache.torque.dsfactory.TorqueDataSourceFactory
> (TorqueDataSourceFactory.java:139) - java.lang.NullPointerException at
>  org.apache.torque.dsfactory.TorqueDataSourceFactory.initCPDS(TorqueDataSourceFactory.java:129)
at
>
>  org.apache.torque.dsfactory.TorqueDataSourceFactory.initialize(TorqueDataSourceFactory.java:108)
at
>  org.apache.torque.Torque.initDataSourceFactories(Torque.java:323) at
>  org.apache.torque.Torque.initialize(Torque.java:237) at
>  org.apache.torque.Torque.init(Torque.java:406) at
>  org.apache.torque.Torque.init(Torque.java:386) at
>  HelperServlet.handleRequest(HelperServlet.java:109) at
>  org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:372)
>  ...  [more snipped]
>
>
> I've tried setting all kinds of properties file keys for connections and
> pools and yet thing null pointer keeps appearing.  I tried looking into
> the source xreference on the site for clues but it seems to be out of
> date; the line numbers don't match anything meaningful.
>
> The result of this is that Torque can't get connection to the database,
> which really limits its functionality (it works in most areas if I
> pass my own connection in, but some functions don't allow that).
>
> I'm really stuck on this, can't figure out what I am doing wrong that
> the data source factory won't configure/init properly.
>
> Ant can connect to my database just find with its build.properties.  I'm
> calling Torque.init() with a path to a Torque.properties as well.  I am
> certain the configuration is being read into torque because I can loop
> through the keys and see them in debugging.  But somehow I'm missing
> something that the datasource wants, and I don't know what.
>
> Jenny Brown
>
>
>


Mime
View raw message