On 10/07/2010 05:15, Caldarale, Charles R wrote:
>> From: Christian Bruckhoff [mailto:christian.bruckh...@gmx.de]
>> Subject: Re: Connecting Tomcat to a database
>>
>> ERROR - GeronimoLog.error(108) | Failed to resolved external 
>> DataSource at "java:comp/env/jdbc/TestDB".
>> javax.naming.NameNotFoundException: Name jdbc is not bound
>> in this Context
>>
>> Any idea, what's wrong?
> 
> I downloaded and installed ODE on Tomcat 7, configured it for MySQL, and was 
> able to reproduce the above error.  (Contrary to popular belief, there is no 
> space in the error message - that was just a figment of whatever 
> transposition mechanism the OP used.  The grammar in the message is flawed, 
> though.)
> 
> Luckily, there's an easy fix (or at least a workaround): get rid of the 
> original .war file.  Once Tomcat has expanded ode.war into the ode directory, 
> the .war file is no longer needed, and in fact is somehow interfering with 
> the use of the directory.  Deleting the .war (or changing the extension) lets 
> the META-INF/context.xml file get processed, thus defining the JNDI data 
> source.  The same effect can be achieved by placing the <Context> element in 
> conf/Catalina/[host]/ode.xml, which will override any in META-INF/context.xml 
> (in either the .war file or the directory).
> 
> I have no idea if things are supposed to work this way, or if this is a bug 
> in Tomcat 7 (haven't tried ODE on any other version).  Perhaps the lack of a 
> context.xml file inside META-INF of the .war causes Tomcat to ignore the one 
> in the expanded directory.

Yep. If there is a WAR file, Tomcat will deploy from that. If there is
no META-INF/context.xml in the WAR then Tomcat uses the defaults. It
will not go looking in the expanded directory. However, if the
context.xml file was placed in CATALINA_BASE/conf/<engine name>/<host
name> then it should take effect.

Mark



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

Reply via email to