Re: Barracuda: slightly OT: tomcat context control files
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Stefan, That's actually a "Context Configuration File". It is Tomcat specific and contains a single <Context ...> element which, normally, would be entered into Tomcat's servler.xml. In Tomcat-4.1.x (or was it 4.0.x?), however, they introduced the concept of defining a context outside the server.xml. This allows for the ability to define your context without having to edit the master server.xml file. Look in Tomcat-4.1.x's webapps directory and you will find two xml files. One called "admin.xml" and one called "manager.xml". Tomcat reads those as if it were defined in the server.xml. In Barracuda's case, you can use the "install" target of the build and it will dynamically install Barracuda to Tomcat as long as you have TOMCAT_HOME defined as a system environment variable and have defined a manager username and password in the build.properties file which matches a user in Tomcat's tomcat-users.xml file which has the role of "manager". You also need to make sure that xmlc related jars are either in WEB-INF/lib or in CATALNIA_HOME/shared/lib (I always put them in the latter especially since the xerces jar isn't supposed to be in WEB-INF/lib, but that is a another discussion...). In Barracuda, the ccf.xml file doesn't do much other than provide for a logger so that you can look in CATALINA_HOME/logs and find a file similar to this one: localhost_Barracuda_servlet_log.2003-01-05.txt However, it can be utilized to a much greater extent such as defining JNDI resources and anything else supported by the <Context> element. The main thing it does, though, is to make it so that your build can be anywhere on the system and installed to Tomcat without copying anything to Tomcat's webapps directory. The path for where your build exists is determined by the build.xml which does a filter copy of sample.ccf.xml to ccf.xml with the dynamically generated path to the WAR directory structure (the current path to the "Barracuda" directory). The ccf.xml file is used by the Tomcat Ant manager task to provide information to Tomcat for how to install your app, temporarily, into memory. When Tomcat is shut down, the app need to be re-installed. The "deploy" task permanently installs your app so, don't use that one. It physically updates the server.xml. You don't want to use that except for permanent deployment. This is actually a pretty long-winded description for what it does. The best way to find out about it is to try it out using: ant install Just make sure to have said pre-requisites in place before you run this or the install will fail. Now go to: http://localhost:8080/Barracuda/ It should be up and running! See the Tomcat documentation for more info: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automatic%20Application%20Deployment Additionally, <quote source="unknown"> For the deploy command, simply include your context confgiuration file in the WAR at "META-INF/context.xml". In Tomcat 4.1, you can dynamically deploy a "context configuration file" instead of, or along with your webapp. Such a file can contain the <Context> element, and all nested subelements, from what you would normally put in server.xml, so you can indeed dynamically deploy an app with a custom realm. </quote> Barracuda doesn't yet make use of the META-INF/context.xml capability for the deploy command. I, actually, only found out about this capability relatively recently so I haven't implemented it yet. Wouldn't be difficult, though, so maybe I will once the new server is up at its new hosting environment. Jake At 03:20 PM 1/5/2003 +0100, you wrote: >Hi, > >Barracuda's uses a ccf.xml in WEB-INF. Has anyone found some docu for >using ccf? Not in a barracuda-specific way more general. I could not >found such a thing on jakarta.apache.org. > >Thanks, >Stefan > >_______________________________________________ >Barracuda mailing list >[email protected] >http://www.enhydra.org/mailman/listinfo.cgi/barracuda >FAQ - http://www.jguru.com/faq/Barracuda