You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by joe <jj...@gmail.com> on 2012/11/03 18:20:10 UTC

Re: Tomcat v7 Embedded

Jesse Farinacci <jieryn <at> gmail.com> writes:

> 
> Greetings,
> 
> I am trying to embed Tomcat v7.0.11 into a self-contained, executable
> jar. The jar is created using Maven (assembly plugin) which packages
> the required Tomcat embedded classes and also an unpacked WAR archive.
> The listed Main-Class does a very simple creation of a Tomcat server
> and launches it. The unpacked WAR exploits Servlet 3.0 classpath
> scanning.
> 
> Is there no way to point the docBase at the executable jar itself,
> again which contains the unpacked WAR, and have it auto-extract itself
> or otherwise be useful? Embedded Jetty provides this capability and it
> is exceptionally useful.
> 
> So, right now Tomcat 7 is firing up and serving requests. I just can
> not figure out the magic incantation to get it to locate the embedded
> and unpacked WAR where it itself is executing from. Thanks in advance,
> 
> -Jesse
> 


Have you tried pointing tomcat to expect the exploded 
war in a folder that is a sibling to the jar file?

If you did this and then added logic to extract and 
explode the war to that folder as the first activity
 in your main class (using java's zip libraries) then forward 
on execution to tomcat, perhaps it would pick 
up the war?





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org