You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "John G." <un...@gmail.com> on 2011/04/26 05:19:56 UTC

Re: Tomcat 6 Context not created, deployment fails

Mark Thomas <markt <at> apache.org> writes:

> 
> On 22/03/2011 21:53, Billy Bacon wrote:
> > Awesome Mark, that worked perfectly!
> > 
> > I'd like to actually run the app out of the war file without exploding it 
and I was able to accomplish this by
> setting unpackWARs="false" in the server.xml. 
> 
> It shouldn't be doing that if the WAR is outside the appBase. That loks
> like a bug. Tomcat 7 was doing this and I fixed that fairly recently.
> 
> > I know this isn't 'preferred' but how would I go about 'hot-patching' let's 
say a JSP for the webapp in this
> setup? Typically I do this within the exploded directory and the next time the 
JSP is requested, it
> re-compiles and life is good.
> 
> In that case you'll have to expand your WAR and set the docBase to the
> expanded directory.
> 
> > Regarding the documentation... I think it's great. I think a concrete 
example and mentioning (with an
> example) that the docBase needs to be outside of the 'webapps' directory would 
have prevented me from
> mailing the alias. I think I was close with what I originally had using the 
docs alone but it wasn't clear to
> me that the docBase needed to be outside of the appBase. 
> 
> The relevant docs are:
> http://tomcat.apache.org/tomcat-7.0-
doc/config/host.html#Automatic%20Application%20Deployment
> and
> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
> 
> There is certainly scope in there for a sentence or two about deploying
> a WAR/directory under a context path not related to its name and/or
> deploying a WAR/directory it multiple times. Drafts welcome.
> 
> Mark
> 

Hi Mark,

In regards to your recommendations, the documentation and in line with multiple 
contexts sharing a single war file:

- the situation is like the one above
- there are no crushes, Tomcat works fine
- 'docBase' is insensitive to both relative and absolute paths
- The issue: only one context can be accessed. 

Specifics:
- Tomcat version: 7.0.12
- Context: multiple, different names (i.e. ACon.xml, BCon2.xml, etc.),path - 
different,  everything else - identical, deployed in the same directory (meta-
inf)
- the name 'context.xml' MUST be present 
- other context files accepted but ignored
- The Manager indicates only one application available, located at the path of 
the 'context.xml'
- Errors generated if there are more then 1 (one) context / file (i.e. 
context.xml)
- the war file: contains all contexts
- we are using NetBeans for development and we haven't had any problems with the 
two integrated platforms

We would appreciate if you can have a look at it when you have a minute and let 
us know. We assume we make some kind of mistake.

Best regards,
John


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


RE: Tomcat 6 Context not created, deployment fails

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John G. [mailto:unfoldingart@gmail.com] 
> Subject: Re: Tomcat 6 Context not created, deployment fails

> In regards to your recommendations, the documentation and 
> in line with multiple contexts sharing a single war file:

> - the situation is like the one above

Not sure what that means.

> - there are no crushes, Tomcat works fine

Glad that nothing is getting squeezed flat.

> - 'docBase' is insensitive to both relative and absolute paths

Not really true; be very, very careful with relative paths, since the directory you're starting from might not be what you think it is.

> - The issue: only one context can be accessed. 

Not sure what that means.  You need to provide precise specifics: URL(s) used, statuses received, entries in the log file, etc.

> - Tomcat version: 7.0.12

Thanks for that; many people forget to tell us.

> - Context: multiple, different names (i.e. ACon.xml, 
> BCon2.xml, etc.),path - different,  everything else -
> identical, deployed in the same directory (meta-inf)

None of the above is actually meaningful to anyone who can't read your mind.

> - the name 'context.xml' MUST be present 

Where?

> - other context files accepted but ignored

What other "context files" do you think there could be?

> - The Manager indicates only one application available, 
> located at the path of the 'context.xml'

Which is where?

> - Errors generated if there are more then 1 (one) 
> context / file (i.e. context.xml)

What errors?  How can you have multiple context.xml files in the same directory?

> - the war file: contains all contexts

That makes no sense at all.

> - we are using NetBeans for development and we haven't 
> had any problems with the two integrated platforms

No idea what that means or if it's relevant.

Unless we can use the Pidster's crystal ball, it's very difficult to be sure what you're trying to do.  If you want to have a single .war file deployed under multiple URL paths, do the following:

1) Place the .war file outside of the <Host> appBase directory.

2) Create one file for each desired URL path in Tomcat's conf/Catalina/[host] directory, using the desired path as the name of the file with a .xml extension.

3) The contents of each of the files from #2 must be a single <Context> element, with a docBase attribute pointing to the location of the .war file.  The path attribute must not be used, but other attributes may.

4) Any META-INF/context.xml file inside the .war will be ignored.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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