• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

context deployment issue

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Tomcat 6.0. I need to deploy a war file that resides in an external directory.
But I need to deploy it into a custom path in the webapp folder in tomcat.

I am using a context file that is located in:
\Tomcat_6.0\conf\Catalina\localhost\aaa#bbb.xml

with the contents of the xml file:

<Context path="/aaa/bbb" docBase="D:\deployments\custom.war" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="llservlet." suffix=".txt" timestamp="true"/>
</Context>


The end result i am looking for is that custom.war is expanded into: tomcat\webapp\aaa\bbb

but i end up with: tomcat\webapp\aaa#bbb

The tomcat docs specify that the '#' is used in the xml file name to create a context path.
Not sure what i am doing wrong, any help much appreciated,
thank you
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you read about the '#' should do anything special??

The name of the xml file will be the context path.

and in the documentation - http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html - is the following written:

Deploy using a Context configuration ".xml" file

If the Host deployXML flag is set to true you can deploy a web application using a Context configuration ".xml" file and an optional ".war" file or web application directory. The context path is not used when deploying a web application using a context ".xml" configuration file.

 
thomas Fuchs
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks,

your right but i am not using the 'path' to specify the path.


In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g. foo#bar.xml for a context path of /foo/bar. The default web application may be defined by using a file called ROOT.xml.

From URL: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

so if i understand correctly the name of the xml file is used as the context path: my xml file is called 'aaa#bbb.xml' and the war file ends up being expanded into: tomcat_home\webapps\aaa#bbb\...

so the above statement from tomcat docs says using the '#' will provide multi-level context paths ....

thanks for the response; note this did work in tomcat 5.5 but i just upgraded our servers to tomcat 6 and it is not working ...
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've now tried the configuration, and Yes there will be created a folder in webapps with the name aaa#bbb - but the context the web application is called with is /aaa/bbb

It is working for me with the configuration you have posted
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic