You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Johannes Plachy <jo...@jps.at> on 2003/08/20 21:09:15 UTC

problems with torque at runtime

Hello,

I am new to torque and tryingto get it up and running without success.
code generation and db initialization works fine, but runtime usage
doesnt work.

I am using a fairly simple mysql db with just one table without need of
an idbroker.

my runtime config: ( no factory worked for me...)

torque.database.default : registerx
torque.database.registerx.adapter : mysql
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 : com.mysql.jdbc.Driver
torque.dsfactory.default.connection.url :
jdbc:mysql://192.168.100.1/TEST
torque.dsfactory.default.connection.user : johannes
torque.dsfactory.default.connection.password : test
torque.database.registerx.maxConnections : 10
torque.database.registerx.expiryTime : 3600000

this is the exception I always get on my first access to the db:

38997 [Thread-5] WARN oid.IDBroker  - IDBroker is being used with db
'REGDAT', 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.
39017 [Thread-12] DEBUG oid.IDBroker  - IDBroker thread was started.
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
exception
org.apache.jasper.JasperException: Connection object was null. This
could be due to a misconfiguration of the DataSourceFactory. Check the
logs and Torque.properties to better determine the cause.
	
does anybody know the reason why this doesn't work ?
Johannes


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: problems with torque at runtime

Posted by Johannes Plachy <Jo...@jps.at>.
Hi Giulio,

I am running my webapp from within eclipse and almost always start and stop
tomcat
( which is the only one running) during testcycles.
Maybe I should have a look at the implementation of Torque.init, as I wonder
why I never get an exception although the (torque-db)connection is never
initialized correctly.
Is there a known set of properties which have to be set correctly for torque
to initialize completely
( other than these in the documentation ?)
The best solution for my would be anyway having torque using the datasource
defined through JNDI,
but by now all documented connection methodes failed at runtime.
Curiously I never had any problems at build-time - initializing the db and
codegeneration works
smoothly.

regards
Johannes

----- Original Message ----- 
From: "Giulio Vezzelli" <gi...@infolog.it>
To: "Apache Torque Users List" <to...@db.apache.org>
Sent: Friday, August 22, 2003 2:29 AM
Subject: Re: problems with torque at runtime


> Johannes Plachy wrote:
>
> >Cameron,
> >
> >Torque always claims to be initialized correctly ( Torque.isInit()
> >returns true) and the
> >initialization itself is done without error message.
> >
> >Currently I switched to Tomcat-managed Datasources and pass a Connection
> >object to each Torque-peer class method.
> >This works fine, but I quess is not the cleanest solution.
> >
> >Johannes
> >
> >( following my init servlet code )
> >
> Hi Johannes,
>
> I get the same error (connection object was null) if I use Torque in a
> webapp and I reload it from the Tomcat manager. I think the issue is
> re-initializing Torque without properly shutting it down (if I tried all
> methods related to shutdown). If I restart the whole container (Tomcat,
> in this case) the webapp works fine again. I don't know if it helps, but
> it may be a similar problem (and the solution might solve mine too!)
>
> Greetings,
>
> Giulio Vezzelli
>
> Infolog S.r.l.
> Via Alfieri, 28
> Modena - 41100
> Telefono : +39-059-822446
> Web : http://www.infolog.it
> E-mail : giulio.vezzelli@infolog.it
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: problems with torque at runtime

Posted by Giulio Vezzelli <gi...@infolog.it>.
Johannes Plachy wrote:

>Cameron,
>
>Torque always claims to be initialized correctly ( Torque.isInit()
>returns true) and the 
>initialization itself is done without error message.
>
>Currently I switched to Tomcat-managed Datasources and pass a Connection
>object to each Torque-peer class method.
>This works fine, but I quess is not the cleanest solution.
>
>Johannes
>
>( following my init servlet code )
>
Hi Johannes,

I get the same error (connection object was null) if I use Torque in a 
webapp and I reload it from the Tomcat manager. I think the issue is 
re-initializing Torque without properly shutting it down (if I tried all 
methods related to shutdown). If I restart the whole container (Tomcat, 
in this case) the webapp works fine again. I don't know if it helps, but 
it may be a similar problem (and the solution might solve mine too!)

Greetings,

Giulio Vezzelli

Infolog S.r.l.
Via Alfieri, 28
Modena - 41100
Telefono : +39-059-822446
Web : http://www.infolog.it
E-mail : giulio.vezzelli@infolog.it




---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: problems with torque at runtime

Posted by Johannes Plachy <jo...@jps.at>.
Cameron,

Torque always claims to be initialized correctly ( Torque.isInit()
returns true) and the 
initialization itself is done without error message.

Currently I switched to Tomcat-managed Datasources and pass a Connection
object to each Torque-peer class method.
This works fine, but I quess is not the cleanest solution.

Johannes

( following my init servlet code )


 public void init(ServletConfig config) throws ServletException
    {
        super.init(config);

        try
        {
            InputStream configStream =
                getServletContext().getResourceAsStream(
config.getInitParameter("config"));
            PropertiesConfiguration c = new PropertiesConfiguration();
            c.load(configStream);
            
            Torque.init(c);
            
        }
        catch (IOException e)
        {
            throw new ServletException(e.toString());
        }
        catch (TorqueException e)
        {
            throw new ServletException(e.toString());
        }




-----Original Message-----
From: Cameron Hickey [mailto:cam@panoramatos.com] 
Sent: Donnerstag, 21. August 2003 08:59
To: 'Apache Torque Users List'
Subject: RE: problems with torque at runtime


Johannes,

I get the first error (about transactions) on my site as well, and I
have been ignoring it because everything still functions.  The second
error:

org.apache.jasper.JasperException: Connection object was null. This
could be due to a misconfiguration of the DataSourceFactory

I have found is caused by the inability of your torque init servlet to
find the Torque.properties file.

Where is your properties file located?  How are you loading it into your
initialization servlet?

Cameron

-----Original Message-----
From: Johannes Plachy [mailto:johannes.plachy@jps.at] 
Sent: Wednesday, August 20, 2003 10:09 PM
To: torque-user@db.apache.org
Subject: problems with torque at runtime

Hello,

I am new to torque and tryingto get it up and running without success.
code generation and db initialization works fine, but runtime usage
doesnt work.

I am using a fairly simple mysql db with just one table without need of
an idbroker.

my runtime config: ( no factory worked for me...)

torque.database.default : registerx torque.database.registerx.adapter :
mysql 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 : com.mysql.jdbc.Driver
torque.dsfactory.default.connection.url :
jdbc:mysql://192.168.100.1/TEST torque.dsfactory.default.connection.user
: johannes torque.dsfactory.default.connection.password : test
torque.database.registerx.maxConnections : 10
torque.database.registerx.expiryTime : 3600000

this is the exception I always get on my first access to the db:

38997 [Thread-5] WARN oid.IDBroker  - IDBroker is being used with db
'REGDAT', 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. 39017
[Thread-12] DEBUG oid.IDBroker  - IDBroker thread was started.
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
exception
org.apache.jasper.JasperException: Connection object was null. This
could be due to a misconfiguration of the DataSourceFactory. Check the
logs and Torque.properties to better determine the cause.
	
does anybody know the reason why this doesn't work ?
Johannes


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


RE: problems with torque at runtime

Posted by Cameron Hickey <ca...@panoramatos.com>.
Johannes,

I get the first error (about transactions) on my site as well, and I
have been ignoring it because everything still functions.  The second
error:

org.apache.jasper.JasperException: Connection object was null. This
could be due to a misconfiguration of the DataSourceFactory

I have found is caused by the inability of your torque init servlet to
find the Torque.properties file.

Where is your properties file located?  How are you loading it into your
initialization servlet?

Cameron

-----Original Message-----
From: Johannes Plachy [mailto:johannes.plachy@jps.at] 
Sent: Wednesday, August 20, 2003 10:09 PM
To: torque-user@db.apache.org
Subject: problems with torque at runtime

Hello,

I am new to torque and tryingto get it up and running without success.
code generation and db initialization works fine, but runtime usage
doesnt work.

I am using a fairly simple mysql db with just one table without need of
an idbroker.

my runtime config: ( no factory worked for me...)

torque.database.default : registerx
torque.database.registerx.adapter : mysql
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 : com.mysql.jdbc.Driver
torque.dsfactory.default.connection.url :
jdbc:mysql://192.168.100.1/TEST
torque.dsfactory.default.connection.user : johannes
torque.dsfactory.default.connection.password : test
torque.database.registerx.maxConnections : 10
torque.database.registerx.expiryTime : 3600000

this is the exception I always get on my first access to the db:

38997 [Thread-5] WARN oid.IDBroker  - IDBroker is being used with db
'REGDAT', 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.
39017 [Thread-12] DEBUG oid.IDBroker  - IDBroker thread was started.
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
exception
org.apache.jasper.JasperException: Connection object was null. This
could be due to a misconfiguration of the DataSourceFactory. Check the
logs and Torque.properties to better determine the cause.
	
does anybody know the reason why this doesn't work ?
Johannes


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org