tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Changing embedded Tomcat from v6 to v7 causes InitialContext lookup to fail
Date Tue, 03 May 2011 12:21:58 GMT
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message