Re: running packed WAR files with embedded tomcat

2014-01-23 Thread Valery Shyshkin
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 > Thanks for the example Valery. Eve

Re: running packed WAR files with embedded tomcat

2014-01-22 Thread John Cartwright - NOAA Federal
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

Re: running packed WAR files with embedded tomcat

2014-01-21 Thread Valery Shyshkin
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", "D:\\VnsTestApps

Re: running packed WAR files with embedded tomcat

2014-01-21 Thread Valery Shyshkin
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 > Try: > > File baseDir = new File(System.getProperty("java.io.tmpdir")); > tomcat.addContext("", baseDir.getAbsolutePath()); > > > > > 2014/1/22 J

Re: running packed WAR files with embedded tomcat

2014-01-21 Thread Valery Shyshkin
Try: File baseDir = new File(System.getProperty("java.io.tmpdir")); tomcat.addContext("", baseDir.getAbsolutePath()); 2014/1/22 John Cartwright - NOAA Federal > Thanks for the suggestion Valery, but swapping the arguments doesn't work. > > --john > > > > On Tue, Jan 21, 2014 at 8:12 AM, Vale

Re: running packed WAR files with embedded tomcat

2014-01-21 Thread John Cartwright - NOAA Federal
Thanks for the suggestion Valery, but swapping the arguments doesn't work. --john On Tue, Jan 21, 2014 at 8:12 AM, Valery Shyshkin wrote: > May be tomcat.addWebapp(contextName,pathToWarFile) instead of > tomcat.addWebapp(pathToWarFile, contextName) will help yoo. > > > 2014/1/21 John Cartwrigh

Re: running packed WAR files with embedded tomcat

2014-01-21 Thread Valery Shyshkin
May be tomcat.addWebapp(contextName,pathToWarFile) instead of tomcat.addWebapp(pathToWarFile, contextName) will help yoo. 2014/1/21 John Cartwright - NOAA Federal > Hello All, > > I'm trying to create a very basic embeded tomcat 7 application to host a > packed WAR file. My code looks like: >

running packed WAR files with embedded tomcat

2014-01-20 Thread John Cartwright - NOAA Federal
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 startu