jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Chelimsky" <da...@chelimsky.org>
Subject Re: NoInitialContextException
Date Sat, 01 Nov 2003 22:01:56 GMT
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" <vmassol@pivolis.com>
To: "'Cactus Users List'" <cactus-user@jakarta.apache.org>
Cc: <david@chelimsky.org>
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
>
>
>


Mime
View raw message