Tomcat 7 embedded doesn't need a war file to be unpacked. I have a Spring
based application packaged in war and it works.
Do you really use Tomcat embedded jars on the classpath or may be from
Tomcat installation?
2014/1/22 John Cartwright - NOAA Federal john.c.cartwri...@noaa.gov
Thanks
Thanks for the example Valery. Even with your approach, I'm finding that
unless I create a directory webapps in the directory from which I run the
program, I get this exception:
java.io.IOException: Application base [{1}] for host [/tmp/./webapps] does
not exist or is not a directory.
It seems
May be tomcat.addWebapp(contextName,pathToWarFile) instead of
tomcat.addWebapp(pathToWarFile, contextName) will help yoo.
2014/1/21 John Cartwright - NOAA Federal john.c.cartwri...@noaa.gov
Hello All,
I'm trying to create a very basic embeded tomcat 7 application to host a
packed WAR file.
Thanks for the suggestion Valery, but swapping the arguments doesn't work.
--john
On Tue, Jan 21, 2014 at 8:12 AM, Valery Shyshkin vns.shysh...@gmail.comwrote:
May be tomcat.addWebapp(contextName,pathToWarFile) instead of
tomcat.addWebapp(pathToWarFile, contextName) will help yoo.
Try:
File baseDir = new File(System.getProperty(java.io.tmpdir));
tomcat.addContext(, baseDir.getAbsolutePath());
2014/1/22 John Cartwright - NOAA Federal john.c.cartwri...@noaa.gov
Thanks for the suggestion Valery, but swapping the arguments doesn't work.
--john
On Tue, Jan 21, 2014
By the way it's not a suggestion it's a signature of the addWebApp method.
I'll try to find my working code and send it.
2014/1/22 Valery Shyshkin vns.shysh...@gmail.com
Try:
File baseDir = new File(System.getProperty(java.io.tmpdir));
tomcat.addContext(, baseDir.getAbsolutePath());
The code below works fine on my Win 7 PC
final Tomcat tomcat = new Tomcat();
tomcat.setPort(9191);
//File baseDir = new File(System.getProperty(java.io.tmpdir));
File baseDir = new File(.);
tomcat.addContext(, baseDir.getAbsolutePath());
tomcat.addWebapp(/WebApplication2,
Hello All,
I'm trying to create a very basic embeded tomcat 7 application to host a
packed WAR file. My code looks like:
Tomcat tomcat = new Tomcat()
tomcat.setPort(port)
tomcat.setBaseDir(.)
tomcat.addWebapp(pathToWarFile, contextName)
It seems to work, but I'm getting an exception on startup