Ah, that was it - thanks. Andrew
On 3 May 2011 21:57, Andrew Brock <catc...@gmail.com> wrote: > ---------- Forwarded message ---------- > From: Mark Thomas <ma...@apache.org> > Date: 3 May 2011 21:51 > Subject: Re: Changing embedded Tomcat from v6 to v7 causes > InitialContext lookup to fail > To: Tomcat Users List <users@tomcat.apache.org> > > > On 03/05/2011 12:54, Andrew Brock wrote: >> (Note: this question is also on StackExchange at >> http://stackoverflow.com/questions/5866237/) >> >> I'm using JUnit test cases to exercise my web service using embedded >> Tomcat. Under Tomcat 6 everything was working fine, but when I >> switched my project to Tomcat 7 I'm coming unstuck. >> >> I've changed my code to use the new org.apache.catalina.startup.Tomcat >> class (available in Tomcat 7) as follows: >> >> ****** >> >> Tomcat tomcat = new Tomcat(); >> tomcat.setBaseDir("C:\\Program Files\\Apache Software >> Foundation\\Tomcat 7.0.11"); >> tomcat.setPort(1234); >> tomcat.addWebApp("/DecoderServiceTest", >> System.getProperty("user.dir")+"/build/web"); >> tomcat.setHostname("localhost"); >> tomcat.start(); > > Add the following before you start the instance: > > tomcat.enableNaming() > > Mark > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org