On 3 March 2013 11:34, Konstantin Kolinko <knst.koli...@gmail.com> wrote:

> 2013/3/3 James Green <james.mk.gr...@gmail.com>:
> > We have a war archive that includes a netbeans-generated context.xml for
> tomcat deployment.
> >
> > If we drop this war into webapps, the context root remains that of the
> war filename.
>
> As expected, in any of 7.0., 6.0 and even 5.5 .
> Have you read the docs (Context chapter in Configuration reference)?
>

I did. Allow me to digress a little to provide insight into how I read the
documentation.

First I got to the main documentation and click section 4: Deployer. Scroll
down to "Deploying on a running Tomcat server" - this is exactly what I
want. I read that provided autoDeploy is set to true Tomcat will unpack
.war files deployed to something called appBase - this seems to mean the
webapps folder when Googling around for application deployment directory in
Tomcat. No idea at this point if autoDeploy is true or not, one way to find
out - try it. Sure enough the war file gets consumed.

So now I have a war deployed. Easy enough. Now to set the URL path. There a
lot of talk about Context Descriptors on that page, and at the top one
seems to be read from webapps/[my-war-file]/META-INF/context.xml. Perfect,
but what goes in it?

Elsewhere, I find Config, and in there we find Context. Aha! Parallel
Deployment? Nope don't want that. Naming? I read that several times, and I
have no idea still what is trying to be expressed. Does it even apply to
me? Not sure, let's move on and see if anything else seems directly related
to what I'm doing. Defining a Context: That's what I want. First option -
META/INF/context.xml. Aha. Do we have an example with sensible example
values to change? No. OK, let's see if Netbeans can help out. Set the
project to run inside Tomcat, and deploy to my named context path. After
running, I have a META-INF/context.xml with a couple of attributes that
match the documentation.

Perfect. I can deploy from Netbeans, but still deploying by dropping into
the webapps folder doesn't have the fully desired effect. If I do the same
with Glassfish using it's config file, I do get the desired effect. Seems
simple enough... Wonder what's different...

OK I've digressed enough, and still I've not spotted anything clear and
concise telling me what I'm doing wrong.

Apologies if I am being really, really, blind!

Thanks,

James

Reply via email to