Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 2765 invoked from network); 22 Jun 2006 19:21:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jun 2006 19:21:56 -0000 Received: (qmail 14852 invoked by uid 500); 22 Jun 2006 19:21:42 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 14665 invoked by uid 500); 22 Jun 2006 19:21:41 -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 14653 invoked by uid 99); 22 Jun 2006 19:21:41 -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:21:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.111.4.27] (HELO out3.smtp.messagingengine.com) (66.111.4.27) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 12:21:40 -0700 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id 53822D861A3 for ; Thu, 22 Jun 2006 15:21:19 -0400 (EDT) Received: from web2.messagingengine.com ([10.202.2.211]) by frontend3.internal (MEProxy); Thu, 22 Jun 2006 15:21:20 -0400 Received: by web2.messagingengine.com (Postfix, from userid 99) id 039F6B5A3; Thu, 22 Jun 2006 15:21:19 -0400 (EDT) Message-Id: <1151004079.19865.264450550@webmail.messagingengine.com> X-Sasl-Enc: EpbyxG7um24DrdVlKJx0+JXP/+4FXlt97MDHvBTCGZuG 1151004079 From: "Ashvini K Saxena" To: "Tomcat Users List" Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MIME::Lite 5022 (F2.72; T1.15; A1.62; B3.04; Q3.03) References: <1150999842.430.264444553@webmail.messagingengine.com> <1151003934.19132.264450156@webmail.messagingengine.com> Subject: Re: Problem configuring JNDI DataSource for Oracle In-Reply-To: <1151003934.19132.264450156@webmail.messagingengine.com> Date: Fri, 23 Jun 2006 00:51:19 +0530 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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