Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 18323 invoked from network); 22 Jun 2006 19:54:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jun 2006 19:54:58 -0000 Received: (qmail 70600 invoked by uid 500); 22 Jun 2006 19:54:47 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 70005 invoked by uid 500); 22 Jun 2006 19:54:45 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 69994 invoked by uid 99); 22 Jun 2006 19:54:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 12:54:45 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_WHOIS,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [206.190.38.105] (HELO web50707.mail.yahoo.com) (206.190.38.105) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 22 Jun 2006 12:54:44 -0700 Received: (qmail 23286 invoked by uid 60001); 22 Jun 2006 19:54:22 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=O50q7qomROqZqoUn8vOBphuhdVvSfPj1RfwuPhZIJ2z1yEgNFX+jU9eva6SSDAC2MMH0KVOZqFWaQ4nBjaxVRb8pphaJNRzvyK2/qyfB19LLZZ0YQUWxwuunuq5o2BU9MxzNZOq/OHf8fVaZ0bJRevI9cDkF7doGus7vDhja4Uw= ; Message-ID: <20060622195422.23284.qmail@web50707.mail.yahoo.com> Received: from [129.110.198.247] by web50707.mail.yahoo.com via HTTP; Thu, 22 Jun 2006 12:54:22 PDT Date: Thu, 22 Jun 2006 12:54:22 -0700 (PDT) From: Sourabh Antani Reply-To: Sourabh Antani Subject: Re: Problem configuring JNDI DataSource for Oracle To: Tomcat Users List In-Reply-To: <1151004079.19865.264450550@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-353725416-1151006062=:22347" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --0-353725416-1151006062=:22347 Content-Type: text/plain; charset=us-ascii Ashvini, I have faced a similar problem. Instance of the JNDI resource is not being created. In my case, the solution was to remove any spaces tomcat's path. I moved Tomcat directory from c:\Program Files\Apache Software Foundation\Tomcat to c:\Tomcat. JDK has a bug that it cannot find JNDI resource when there is a space in the path. See if that works for you. Regards, Sourabh ----- Original Message ---- From: Ashvini K Saxena To: Tomcat Users List Sent: Thursday, June 22, 2006 2:21:19 PM Subject: Re: Problem configuring JNDI DataSource for Oracle Nope, with that it only gives a proper error message, Invalid connection string format, a valid format is: "host:port:sid" On Fri, 23 Jun 2006 00:48:54 +0530, "Ashvini K Saxena" said: > I figured it out. I had followed Tomcat documentation while doing this. > The Oracle example in the documentation mentioned url as > jdbc:oracle:thin:myschema@127.0.0.1:1521:mysid > Following that I specified my url as > jdbc:oracle:thin:rep@localhost:1521:rep while actually it should be > jdbc:oracle:thin:rep@localhost:1521/rep > > With that change, it worked! > > Ashvini > > On Thu, 22 Jun 2006 23:40:42 +0530, "Ashvini K Saxena" > said: > > I am trying to use a datasource to access an Oracle database (Tomcat > > 5.5.9 and Oracle 9i). I have configured a datasource in the context.xml > > as follows: > > > > > > > reloadable="true"> > > > name="jdbc/reportdb" > > type="javax.sql.DataSource" > > url="jdbc:oracle:thin:rep@localhost:1521:rep" > > driverClassName="oracle.jdbc.OracleDriver" > > password="rep123" > > maxActive="4" > > maxWait="5000" > > maxIdle="2" > > username="rep"/> > > WEB-INF/web.xml > > > > > > In web.xml I am referring to the datasource as: > > > > > > The Reports DataSource > > jdbc/reportdb > > javax.sql.DataSource > > Container > > Unshareable > > > > > > The code for creating connections is something like this: > > try { > > Context ctx = (Context)(new InitialContext().lookup("java:comp/env")); > > DataSource ds = (DataSource)ctx.lookup("jdbc/reportdb"); > > Connection con = ds.getConnection(); > > } catch (NamingException e) { > > e.printStackTrace(); > > } catch (SQLException e) { > > e.printStackTrace(); > > } > > > > The Oracle JDBC driver, classes12.jar is in common/lib. > > > > At runtime I get the following error: > > java.lang.NullPointerException > > org.apache.tomcat.dbcp.dbcp.DelegatingConnection.close(DelegatingConnection.java:151) > > org.apache.tomcat.dbcp.dbcp.PoolableConnection.reallyClose(PoolableConnection.java:95) > > org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.destroyObject(PoolableConnectionFactory.java:301) > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:883) > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) > > gaim.ui.report.action.ShowReport.doPost(ShowReport.java:42) > > > > Has anyone encountered a similar problem and know of a solution? Is > > there anything I am missing in my configuration? > > > > Thanks and Regards, > > > > Ashvini K Saxena > > -- > > Ashvini K Saxena > > ashvini@fastmail.fm > > > > -- > > http://www.fastmail.fm - IMAP accessible web-mail > > > > > > --------------------------------------------------------------------- > > To start a new topic, e-mail: users@tomcat.apache.org > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > > For additional commands, e-mail: users-help@tomcat.apache.org > > > -- > Ashvini K Saxena > ashvini@fastmail.fm > > -- > http://www.fastmail.fm - The professional email service > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > -- Ashvini K Saxena ashvini@fastmail.fm -- http://www.fastmail.fm - The professional email service --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --0-353725416-1151006062=:22347--