Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 96013 invoked by uid 500); 21 Sep 2001 20:07:02 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 95996 invoked from network); 21 Sep 2001 20:07:02 -0000 Message-ID: <19DC8D385DF8D41196050006294F709101884EE1@EG-MSGMBX-B04> From: "Simphoukham, Southin" To: tomcat-user@jakarta.apache.org Subject: Request for help with Oracle 8i connection on Tomcat 4.0 Date: Fri, 21 Sep 2001 15:06:31 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, I am porting a J2EE app to Tomcat 4.0. However I keep getting a null for my datasource retrieval. I am not sure if Tyrex datasource would do the job. Or do I need to create my own Oracle datasource. I should not have too but who knows.Any help would be appreciated. I have the Classes12.zip and jdbc2_0-stdext in the \lib directory. I have the following in my server.xml for Tomcat 4.0. user xxxxx password xxxxx driverClassName oracle.jdbc.driver.OracleDriver driverName jdbc:oracle:thin:@xxx.xxx.xxx.xxx I have the following in my web.xml for my application: action org.apache.struts.action.ActionServlet application ApplicationResources config /WEB-INF/struts-config.xml debug 2 detail 2 validate true 2 action *.do jdbc/OracleDB javax.sql.DataSource Container I am getting the following console output: ----> In Try ----> ctx is: javax.naming.InitialContext@6de49c ----> envCtx is: org.apache.naming.NamingContext@7f0dde ----> have the initial context ----> dataSourceName =jdbc/OracleDB ----> m_jdbcSource = null My JDBCSource.java is: try { if (DEBUG_ON) { System.out.println("----> In Try"); } //InitialContext ctx = new InitialContext(); Context ctx = new InitialContext(); if (DEBUG_ON) { System.out.println("----> ctx is: "+ ctx); } Context envCtx = (Context) ctx.lookup("java:comp/env"); if (DEBUG_ON) { System.out.println("----> envCtx is: " + envCtx); } synchronized (ctx) { if (DEBUG_ON) { System.out.println("----> have the initial context"); } String dataSourceName ="jdbc/OracleDB"; if (DEBUG_ON) { System.out.println("----> dataSourceName ="+ dataSourceName); } //m_jdbcSource = (DataSource) ctx.lookup(dataSourceName); m_jdbcSource = (DataSource) envCtx.lookup(dataSourceName); if (DEBUG_ON) { System.out.println("----> m_jdbcSource = "+ m_jdbcSource); } } //synchronized } catch (Exception e) { if (DEBUG_ON) { System.out.println(THIS +".initializeJDBCBean() failed. Exception: " + e.toString()); } sErrorMessage = e.toString() +" " + THIS + ", method: initializedJDBCBean."; ls.logError(sErrorMessage); } // catch