I've used Torque in a servlet (in Tomcat). Here are some experiences which may be 
helpful:
1) Since Torque.init also accepts a Configuration object, so you can create a 
Configuration object for Torque.properties file and pass to Torque.init. This way you 
can sure that Torque are initialized properly;
2) Since Torque uses torque.applicationRoot for logging, you need to specify a real 
path for this property, otherwise Torque might not find it;
3) All Torque related jar files should be in /WEB-INF/lib and all class files (your 
application + torque generated class) should be in /WEB-INF/classes; 

For database connection problem (if using jdbc2pool), make sure validationQuery is 
proper for you database, for example , "SELECT 1" works for MySQL but not Oracle 
(which should be "SELECT 1 from DUAL").

Howard Lin

> -----Original Message-----
> From: Dave Dutcher [mailto:djdutcher74@;earthlink.net]
> Sent: Friday, October 25, 2002 9:47 AM
> To: Turbine Torque Users List
> Subject: RE: Using Torque with Struts
> 
> 
> Is the WEB-INF folder the right place for the properties 
> file?  In the past
> I've always put properties files I use in the WEB-INF/classes 
> folder.  I
> thought that generally properties files were loaded from the 
> class path, and
> classes is in the class path, where I didn't think just WEB-INF was.
> 
> I actually haven't used Torque in a servlet before.  (I'm 
> planing on it,
> that's why I just subscribed to this list :)  You say the 
> servlet is finding
> the properties file though, so I guess this is a moot point.  
> I just thought
> I would ask about it.
> 
> Dave
> 
> -----Original Message-----
> From: Bob [mailto:smilyguy@;rocketmail.com]
> Sent: Thursday, October 24, 2002 3:43 PM
> To: Turbine Torque Users List
> Subject: Re: Using Torque with Struts
> 
> 
> This might sound like a stupid question, but what from the
> Torque root directory is required for Torque to run?  I
> took all the Torque JARs from the lib directory and moved
> them under my WEB-INF/lib directory, and placed
> Torque.properties directly into the WEB-INF folder (which
> the servlet is finding thanks to Netbeans).
> 
> There's a bunch of other folders in there too that I
> haven't copied anywhere.  Is there a dependency on any of
> these?
> 
> Secondary question...Is there anything special about the
> name property of the database tag matching anything else?
> I know that it should be the same as xxx-schema.xml, and
> likewise in the build.properties file for Torque.
> 
> I built a relatively trivial main() app, and I get the same
> error.  My Torque.properties file looks right, so I'm
> starting to think I'm missing a dependency.
> 
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.yahoo.com/
> 
> --
> To unsubscribe, e-mail:
> <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:turbine-torque-user-help@;jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:turbine-torque-user-help@;jakarta.apache.org>
> 
> 
-------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.
-------------------------------------------------------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-torque-user-help@;jakarta.apache.org>

Reply via email to