> 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.

As a side note, I found two problems with the ODE 2.0 beta:

1) It doesn't shut down properly.  You can't use Tomcat's shutdown.bat (or .sh) 
script to stop Tomcat, since ODE starts extra threads and fails to terminate 
them when the webapp is being stopped.  You can use a signal (CTRL-c on 
Windows) to get the JVM to shutdown cleanly.

2) The ODE instructions specify the wrong name for the SQL script to initialize 
the database; it should be sql/mysql.sql, not ode_openjpa_mysql-1.3.2.sql (the 
latter appears to be some ancient name).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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

Reply via email to