-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jeff,

On 4/23/13 11:40 AM, Jeffrey Janner wrote:
>> -----Original Message----- From: Christopher Schultz
>> [mailto:ch...@christopherschultz.net] Sent: Thursday, April 18,
>> 2013 5:01 PM To: Tomcat Users List Subject: Re: <resource-ref> in
>> web.xml
>> 
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
>> 
>> Jakub,
>> 
>> On 4/17/13 9:22 PM, Jakub 1983 wrote:
>>> can I define database connection only in web.xml, without
>>> using context.xml files ?
>>> 
>>> can I pass database url, login and password into <resource-ref>
>>> ?
>>> 
>>> when I define database conn in context.xml, resource-ref is
>>> not
>> needed
>>> at all, so what is it actually for ?
>> 
>> If you define your database configuration in server.xml, you'll
>> have to map from global to local scope. You don't need to do this
>> with context.xml because the scope is -- by definition -- already
>> local.
>> 
>> - -chris
> 
> Chris - Am I reading that correctly?  If in my context.xml file, I
> define a DB resource as: <Resource name="jdbc/oracleUCPPool" 
> type="oracle.ucp.jdbc.PoolDataSource" 
> factory="oracle.ucp.jdbc.PoolDataSourceImpl" auth="Container" 
> connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource" ...
> obviously redacted stuff ... /> I DO NOT need to add these lines to
> my web.xml? <resource-ref> <description>Oracle Universal Connection
> Pool</description> <res-ref-name>jdbc/oracleUCPPool</res-ref-name> 
> <res-type>javax.sql.DataSource</res-type> 
> <res-auth>Container</res-auth> </resource-ref>

I believe this is correct. It should be easy to try :)

> That also brings up another, related, question. In my old web.xml,
> I had this entry: <context-param> 
> <param-name>LOG4J_PROPS</param-name> 
> <param-value>/WEB-INF/Log4j.properties</param-value> 
> </context-param> Which I removed and replaced with an entry in the
> context.xml file: <Parameter name="LOG4J_PROPS"
> value="/WEB-INF/Log4j.properties" override="false" /> However, that
> didn't work. I had to provide the full path to the file in the
> value parameter. Is there a particular reason why?

The two above are documented to be equivalent, assuming no other
factors are at work (e.g. Tomcat wasn't reading your new
META-INF/context.xml file because there was one already in
conf/[Engine]/[Host]/[app].xml.

If it's not working, start a new thread to make sure you understand
how it's all supposed to work and possibly follow-up with a bug report.

> Or would it be something inside our code?

Tomcat doesn't use that value for anything, so it must be your code
reading it and interpreting it (hopefully using
ServletContext.getResource()).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJReBYiAAoJEBzwKT+lPKRYsTwQAIx2p8gxjFKeeOnVx/UewP5O
nOAtrYovqbVCwC13P5hgrFPqjvmFtsGcCOeqJuij1GZODIg9OU4Z6Vs5pUISaiDC
p1CFaYEL0PxBtl7wr7KC4A7k7WNnpxCnYauhgOWMR1xJXeXz40Hux32HCK9mNkhL
RP5BYpJqXuO6L53U5lUhA/o0rgKoJVttRt+oqn1tPMBxatZU4MRUrt88zuEk+3va
eQJfGZ05aQv+I6wRQDooQvAtbvhal7vnIx3PBMs40GG1shjkRy9jCz5b4o5BJCuv
bAeeB73Dv/APXs/a4/6fVfzv/wq8l7nxRCod1xYga8q/4o39oJKrJmlVgyTOgbOS
h04raAVhys95pQa8BLfSWr65Vh6wdAufduocS3sL75M09AouUUu4APB0Yt6JrMIH
3z7bbAN4kLXZ+4NfcvYbJtLNh+jFNwbf/B+ZsjXS/t0OUemZ0JXHPN3SvI0mLHPI
NoIgaAi6skAGotYSIXL4Lvr8J9UCuFZZBXb1r7L2tvWyMaMI92Uy2AuYFK3Jdn7E
0p1R8ABhznuN3gbT5pOSiGqNolAeiOAnCMhzQLCJk9LD9srUB/Y1K5H3KQzX9RMa
uralof0w70G3k6bZCVTy3gq726c7D7b//7WtzEHm/bfQK3RIb/E9Ete7b0Loposi
ZwTpY6etPPckA6gsXRa0
=rAMP
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to