Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 29558 invoked from network); 1 Apr 2009 10:30:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 10:30:51 -0000 Received: (qmail 51344 invoked by uid 500); 1 Apr 2009 10:30:46 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 51263 invoked by uid 500); 1 Apr 2009 10:30:46 -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 51252 invoked by uid 99); 1 Apr 2009 10:30:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 10:30:46 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mighty.tornado@gmail.com designates 74.125.92.148 as permitted sender) Received: from [74.125.92.148] (HELO qw-out-1920.google.com) (74.125.92.148) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 10:30:40 +0000 Received: by qw-out-1920.google.com with SMTP id 5so2386100qwf.12 for ; Wed, 01 Apr 2009 03:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=hvWPR4AgG/EuVOQYj42rY7ay0MxOVpMtM8E2ZK8Ypss=; b=OocHBOz+C3og6NaQoR5o86+da/UQIt/OSJ2sBjmf0ezXd84w3QX47kqFr/sLxoJg+k zHhvU6hSUNllePuVXemksVSFLfdvZ+RUypDVoHjVOlAnqcu02ySs2ZSE3EhE4JwgFCF5 s3sjlmnU1MI1kEAvEbBkyhJHfIMdLQr5FTkZ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pGpkTHiIJ0gqj1jBDilxKmC7priwQSrApe3y5CMGJkvqiZjR4jRC5hPmoAzzhgmLrN kN+FeS75NycCpW72WT8Sn2E51MXzoepU3ckTiecw7H6Lp/N1NU18zwN4pBhKYGays2xq RxfSiRxgqGD+Xti53FazEiUorbgK/HDy5EuL4= MIME-Version: 1.0 Received: by 10.224.67.203 with SMTP id s11mr9662047qai.198.1238581819131; Wed, 01 Apr 2009 03:30:19 -0700 (PDT) In-Reply-To: <538752d80904010324r2bec6616if1a559b58f5edec3@mail.gmail.com> References: <8bab7ada0903311836h4ee6304n8d9eabff72aca82a@mail.gmail.com> <8bab7ada0904010257n94e3b1ei9bcdb2305ba9aabb@mail.gmail.com> <5916CCF0-F069-4B5A-B86C-6892BD092ECA@googlemail.com> <8bab7ada0904010307n75ef929bqf30454f6d69e5ed5@mail.gmail.com> <538752d80904010309j2d62f664h9f69b00db7323111@mail.gmail.com> <8bab7ada0904010317n606dcf82r54c86c301f770597@mail.gmail.com> <538752d80904010324r2bec6616if1a559b58f5edec3@mail.gmail.com> Date: Wed, 1 Apr 2009 06:30:19 -0400 Message-ID: <8bab7ada0904010330l49721e53neba1c5ad09af707e@mail.gmail.com> Subject: Re: DataSource from Context files - doesn't work From: Mighty Tornado To: Tomcat Users List Content-Type: multipart/alternative; boundary=0015175cd8405ac72804667bcd12 X-Virus-Checked: Checked by ClamAV on apache.org --0015175cd8405ac72804667bcd12 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit No Exception there. Even after I restart the server and call the Servlet that is supposed to retrieve the DB data. On Wed, Apr 1, 2009 at 6:24 AM, Yassine wrote: > catalina.out > > > On Wed, Apr 1, 2009 at 12:17 PM, Mighty Tornado > wrote: > > I have the following files in the logs directory: > > > > admin.2009-04-01.log > > catalina.out > > localhost.2009-04-01.log > > catalina.2009-04-01.log > > host-manager.2009-04-01.log > > manager.2009-04-01.log > > > > Which one of them should I VI or LESS to find the complete stack trace > for > > the exception? > > > > Also, is there something obviously wrong with my context definition or > > reference? I followed the Tomcat online tutorial to define them. > > Also, previously a regular JDBC code with the same parameters was able to > > access the DB and retrieve the data correctly. > > > > Thank you all. > > > > On Wed, Apr 1, 2009 at 6:09 AM, Yassine >wrote: > > > >> don't "tail -f" > >> use less and copy the part containing the exception from its beginning > >> to the end. > >> > >> > >> > >> On Wed, Apr 1, 2009 at 12:07 PM, Mighty Tornado > >> wrote: > >> > Where can I obtain it? > >> > The exception that I posted is the only exception that showed up > >> following > >> > "tail -f *" > >> > > >> > On Wed, Apr 1, 2009 at 6:04 AM, Gregor wrote: > >> > > >> >> your log is useless. > >> >> please post the complete stacktrace incl. the type of the exception > >> >> > >> >> rds > >> >> > >> >> gregor > >> >> > >> >> Am 01.04.2009 um 11:57 schrieb Mighty Tornado < > mighty.tornado@gmail.com > >> >: > >> >> > >> >> > >> >> Additional info: > >> >>> > >> >>> I get the following exception in the log when I start the server up: > >> >>> > >> >>> ==> localhost.2009-03-03.log <== > >> >>> at > >> >>> > >> >>> > >> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) > >> >>> at > >> >>> > >> >>> > >> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > >> >>> at > >> >>> > >> >>> > >> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) > >> >>> at > >> >>> > >> >>> > >> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > >> >>> at > >> >>> > >> >>> > >> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) > >> >>> at > >> >>> > >> >>> > >> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) > >> >>> at > >> >>> > >> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) > >> >>> at > >> >>> > >> >>> > >> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) > >> >>> at > >> >>> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) > >> >>> at java.lang.Thread.run(Thread.java:613) > >> >>> > >> >>> > >> >>> > >> >>> I use the following code to get the connection: > >> >>> > >> >>> InitialContext ic = new InitialContext(); > >> >>> > >> >>> if(ic == null) > >> >>> { > >> >>> System.out.println("context not found"); > >> >>> } > >> >>> > >> >>> DataSource ds = > >> >>> (DataSource)ic.lookup("java:comp/env/jdbc/vhousehold"); > >> >>> > >> >>> if(ds == null) > >> >>> { > >> >>> System.out.println("DataSource not found"); > >> >>> } > >> >>> > >> >>> conn = ds.getConnection(); > >> >>> > >> >>> stat = conn.createStatement(); > >> >>> > >> >>> rs = stat.executeQuery("SELECT * FROM family_member "); > >> >>> > >> >>> On Tue, Mar 31, 2009 at 9:36 PM, Mighty Tornado < > >> mighty.tornado@gmail.com > >> >>> >wrote: > >> >>> > >> >>> Hi I placed the following in context.xml in META-INF. > >> >>>> But the result set is null, what's wrong with my set up?Can anybody > >> >>>> please > >> >>>> advise? > >> >>>> > >> >>>> > >> >>>> > >> >>>> >> >>>> auth="Container" > >> >>>> description="DB Connection" > >> >>>> name="jdbc/vhousehold" > >> >>>> type="javax.sql.DataSource" > >> >>>> password="vhousehold" > >> >>>> driverClassName="com.mysql.jdbc.Driver" > >> >>>> maxIdle="2" > >> >>>> maxWait="5000" > >> >>>> validationQuery="select * from family_member;" > >> >>>> username="vhousehold" > >> >>>> url="jdbc:mysql://localhost:3306/vhousehold" > >> >>>> maxActive="4"/> > >> >>>> > >> >>>> > >> >>>> Thanks, > >> >>>> > >> >>>> Ramy. > >> >>>> > >> >>>> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >> >> For additional commands, e-mail: users-help@tomcat.apache.org > >> >> > >> >> > >> > > >> > >> > >> > >> -- > >> -- > >> Yassine Elassad > >> Bonn, Germany. > >> Fon : +49 228 97629355 > >> Mobile : +49 157 74519666 > >> > >> PEACE : > >> ( P ) Positive ( E ) Energy ( A ) Always ( C ) Correct ( E ) Errors. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > >> For additional commands, e-mail: users-help@tomcat.apache.org > >> > >> > > > > > > -- > -- > Yassine Elassad > Bonn, Germany. > Fon : +49 228 97629355 > Mobile : +49 157 74519666 > > PEACE : > ( P ) Positive ( E ) Energy ( A ) Always ( C ) Correct ( E ) Errors. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --0015175cd8405ac72804667bcd12--