Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 47929 invoked from network); 1 Nov 2003 22:02:31 -0000 Received: from unknown (HELO t1.cwihosting.com) (64.49.220.232) by daedalus.apache.org with SMTP; 1 Nov 2003 22:02:31 -0000 Received: from 12-213-30-106.client.attbi.com ([12.213.30.106] helo=dell) by t1.cwihosting.com with smtp (Exim 4.24) id 1AG3pM-0008AQ-44 for cactus-user@jakarta.apache.org; Sat, 01 Nov 2003 16:02:36 -0600 Message-ID: <008501c3a0c3$c49a76b0$6501a8c0@dell> From: "David Chelimsky" To: "'Cactus Users List'" References: <003001c3a0c0$a570e470$2502a8c0@vma> Subject: Re: NoInitialContextException Date: Sat, 1 Nov 2003 16:01:56 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - t1.cwihosting.com X-AntiAbuse: Original Domain - jakarta.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - chelimsky.org X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Forgive me for wasting your time, though your response did point me in the right direction. I was trying to run a junit TestCase, not a cactus ServletTestCase (I'm a Cactus newbie). After looking at the cactus documentation and adding the following method, all is well. AND the test passes (though I'd best go back and make sure I can make it fail now). public static Test suite() { ServletTestSuite suite = new ServletTestSuite(); suite.addTestSuite(TestGetDataSource.class); return suite; } Thanks much for your time. David ----- Original Message ----- From: "Vincent Massol" To: "'Cactus Users List'" Cc: Sent: Saturday, November 01, 2003 3:39 PM Subject: RE: NoInitialContextException > David, > > > -----Original Message----- > > From: David Chelimsky [mailto:david@chelimsky.org] > > Sent: 01 November 2003 22:27 > > To: 'Cactus Users List' > > Subject: Re: NoInitialContextException > > > > [snip] > > > public static DataSource getDataSource() throws NamingException { > > Context ctx = new InitialContext(); > > Context env = (Context) ctx.lookup("java:comp/env"); > > DataSource ds = (DataSource) ctx.lookup("/jdbc/cheli"); > > return ds; > > } > > In which cactus method are you calling the getDataSource() method? Is it > from a beginXXX() method, is it from a setUp() method, is it from a > testXXX() method, is it from an endXXX method, etc? > > > > > that's it. If this triggers any ideas for you, please let me know. > > -Vincent > > >