Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 8895 invoked from network); 8 Jul 2003 20:24:54 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 8 Jul 2003 20:24:54 -0000 Received: (qmail 27013 invoked by uid 97); 8 Jul 2003 20:27:25 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 27006 invoked from network); 8 Jul 2003 20:27:24 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 8 Jul 2003 20:27:24 -0000 Received: (qmail 7475 invoked by uid 500); 8 Jul 2003 20:24:39 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 7459 invoked from network); 8 Jul 2003 20:24:38 -0000 Received: from smtp3.america.net (199.170.121.153) by daedalus.apache.org with SMTP; 8 Jul 2003 20:24:38 -0000 Received: from [65.170.18.202] (helo=JEFFREYLT) by smtp3.america.net with smtp (Exim 4.10) id 19Zz0y-0000RV-00 for tomcat-user@jakarta.apache.org; Tue, 08 Jul 2003 16:24:41 -0400 From: "Jeff Cummings" To: "'Tomcat User'" Subject: MSQL and JDNI Date: Tue, 8 Jul 2003 16:24:30 -0400 Message-ID: <000501c3458e$f36b3d70$6401a8c0@JEFFREYLT> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01C3456D.6C6D7390" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0006_01C3456D.6C6D7390 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit I am try to setup a JDNI datasource. This is the exerp from my context. I store app context in $CATILINA_HOME/webapp/myapp.xml file mail.smtp.host localhost factory org.apache.commons.dbcp.BasicDataSourceFactory username uname password pword driverClassName com.ashna.jturbo.driver.Driver url jdbc:JTurbo://MYSERVER:1036/mydatabase I also added the following to web.xml for this app DB Connection jdbc/MSQL javax.sql.DataSource Container My servlet fails � dataSource is null. Here is the code try { Context init = new InitialContext(); Context ctx = (Context) init.lookup("java:comp/env"); DataSource dataSource = (DataSource) ctx.lookup("jdbc/MSQL"); } catch (NamingException ex) { throw new ServletException("Cannot retrieve java:comp/env/jdbc/conversion",ex); } Any ideas????? Jeff ------=_NextPart_000_0006_01C3456D.6C6D7390--