Jevin, it actually sounds like you not just talking about JNDI and defining your own factory, but setting the passwords programmatically for the standard DBCP JNDI factory.... I dont think its possible, but it would be nice to be proved wrong. Keeping passwords in binary form, would require no more than making a class in a library, so I think you actually talking about intercepting TC and changing DBCP passwords. I may be wrong but I think by the time your application even gets to run one line of code.... its too late, especially if its a global resource, defined in server.xml. If you working with embedded stuff, then I think you will be able to configure it, but if I'm not mistaken, that Catalina class via the Digester will kick that whole process off long before it even starts your web-app, so even if you set up a listener, by the time that fires, I think the JDBC pool will already be full of connections made with the xml config password and username.

I dont know.... if someone has used the JNDI DBCP facility, and the customer says, hide those passwords.... what can one do?


----- Original Message ----- From: "Jevin Maltais" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Tuesday, July 03, 2007 9:57 PM
Subject: How internally does a jndi resource get created?


Big picture: Trying to hide the password from the server.xml file and
instead have it in byte code in a compile version of tomcat.

I'm trying to figure out when the jndi resource is being created by
tomcat so I can change the password for a given resource.  It may not
be super clean or OO style but it will work.

Tomcat is kind of overwhelming so I'm looking for help.  It looks like
the HostConfig class parses the server.xml (where my database and
password is defined) and parses it from there but I'm totally lost
where it adds the Resource to JNDI lookup table.

Could someone point me in the right direction?

Cheers!
Jevin

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to