You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Da...@WellsFargo.COM on 2002/04/01 21:09:30 UTC

RE: Torque.properties location?

Follow up to my own thread:

In order to initialize Torque with a properties file somewhere on the
application classpath (in fact, it's in "../WEB-INF/classes") in a Web
application .WAR file (in fact, it's a ZIP file), do this somewhere
(wherever you wish to init Torque, be it in a ContextListener, startup
class, static initializer, whatever):

Class theClass = this.getClass();
ClassLoader theLoader = theClass.getClassLoader();
PropertiesConfiguration config = new PropertiesConfiguration();
config.load(theLoader.getResourceAsStream("Torque.properties"));
Torque.init(config);

Cheers,
David

-----Original Message-----
From: David.A.Ventimiglia@WellsFargo.COM
[mailto:David.A.Ventimiglia@WellsFargo.COM] 
Sent: Thursday, March 28, 2002 2:54 PM
To: turbine-user@jakarta.apache.org
Subject: RE: Torque.properties location?

Or rather, I am NOW getting the path from "getResource" on the ClassLoader.
Typo below.

-----Original Message-----
From: David.A.Ventimiglia@WellsFargo.COM
[mailto:David.A.Ventimiglia@WellsFargo.COM] 
Sent: Thursday, March 28, 2002 2:50 PM
To: turbine-user@jakarta.apache.org
Subject: RE: Torque.properties location?

Instead of using the ServletContext, I'm not getting the path from
"getResource" on the ClassLoader.  The problem is that this returns a path
to a WAR file (ZIP file):

C:/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete/wl_comp19082.wa
r!/WEB-INF/classes/Torque.properties

Torque cannot find this file.

Does anyone know how to do this?  Am I going to have to leave the
Torque.properties file outside of the WAR file?

Thanks!
David

-----Original Message-----
From: David.A.Ventimiglia@WellsFargo.COM
[mailto:David.A.Ventimiglia@WellsFargo.COM] 
Sent: Thursday, March 28, 2002 2:24 PM
To: turbine-user@jakarta.apache.org
Subject: RE: Torque.properties location?

Thanks.  Only problem is, the getRealPath("") method on ServletContext
returns null.  Any other ideas about how I can find this file?  Thanks.

Cheers,
Dave

-----Original Message-----
From: Hoang, Hai [mailto:Hai.Hoang@coair.com] 
Sent: Thursday, March 28, 2002 1:03 PM
To: 'Turbine Users List'
Subject: RE: Torque.properties location?

I put torque.properties in WEB-INF/conf folder...to initialize torque take a
look at this

http://www.mail-archive.com/turbine-user%40jakarta.apache.org/msg07061.html


-----Original Message-----
From: David.A.Ventimiglia@WellsFargo.COM
[mailto:David.A.Ventimiglia@WellsFargo.COM] 
Sent: Thursday, March 28, 2002 2:02 PM
To: turbine-user@jakarta.apache.org
Subject: Torque.properties location?

Hello,

 

I have another question about using Torque.  I'd like to use it in a
stand-alone configuration outside of Turbine, with Weblogic (don't worry, I
intend to test it).  My questions are:

 

1.	If I am deploying my application is a "web app", where should I put
the Torque.properties file?  In the root of the web app, or in the WEB-INF
directory, or in the WEB-INF/classes directory, or somewhere else?

 

2.	After figuring out 1. above, what should be the value for the
torque.applicationRoot property in the Torque.properties file?

 

Thanks in advance!

 

Cheers,

David

 

 

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)

 


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>