What version of Tomcat are you using? I (stupidly) forgot to mention that I am using Tomcat 4.1. A previous response (by Jacob Kjome) to my question indicated that 4.1.xx of Tomcat behaved exactly as I described. He also stated that Tomcat 5 has the behavior I desired. If you are using Tomcat 5, this would confirm his explanation.
-----Original Message----- From: Steph Richardson [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2003 1:15 PM To: Tomcat Users List Subject: RE: Deploying a WAR file referenced by a Context configuration .XML file I'm really interested because you have exactly the setup that I am using in production. Although I'm not sure why you are concerned about how/where the war file get's exploded. In your lingo I use a SHAREDSETUP.xml which explicitly has a context with attribute docbase="/home/appbase/SHAREDSETUP.war" This works fine, I just deploy new versions of SHAREDSETUP.war, Tomcat explodes the war somewhere ( TOMCAT_HOME/work/somethingorother ) and the war has access to my DBCP. Another setup I toyed with was configuring the DBCP in the <DefaultContext> attribute, and then any war file dropped into tomcat should have access to it. > -----Original Message----- > From: Larson, Kirk [mailto:[EMAIL PROTECTED] > Sent: Friday, November 07, 2003 12:48 PM > To: '[EMAIL PROTECTED]' > Subject: Deploying a WAR file referenced by a Context configuration .XML > file > > > I have an applicaiton which is using a connection pool provided by Tomcat. > In order to allow the application to reference the connection pool, I > created a Context configuration file for the application and placed it in > the "webapps" directory. The application is called SHAREDSETUP, and I > placed two files in the webapps directory ... SHAREDSETUP.WAR and > SHAREDSETUP.XML. When I start Tomcat, the WAR file is not automatically > expanded and the application is not started because the "/sharedsetup" > directory does not exist. > > If I delete the SHAREDSETUP.XML file, Tomcat automatically explodes the WAR > file and creates the "/sharedsetup" directory. The application is started > fine, however the application is unable to reference the database > connection. I need the connection pool, therefore this is not an option. > > If I manually explode the WAR file, the application is started successfully > and everything works fine. However, I was hoping to not have to do this. I > have to provide the WAR file to an external group who will be responsible > for deploying the application. I wanted to make the deployment procedure as > simple as possible. > > How do I get Tomcat to automatically explode a WAR file if I need to use a > Context configuratioin XML file? > > Thanks, > Kirk > > > > > contents of "sharedsetup.xml" > ===================================================== > <Context docBase="sharedsetup" cookies="true" path="/sharedsetup" > className="org.apache.catalina.core.StandardContext" crossContext="false" > reloadable="false" > mapperClass="org.apache.catalina.core.StandardContextMapper" > useNaming="true" debug="0" swallowOutput="false" privileged="false" > wrapperClass="org.apache.catalina.core.StandardWrapper" > cachingAllowed="true" > charsetMapperClass="org.apache.catalina.util.CharsetMapper"> > <Logger className="org.apache.catalina.logger.FileLogger" debug="9" > verbosity="1" prefix="localhost_sharedsetup_log." directory="logs" > timestamp="true" suffix=".txt"/> > <ResourceLink name="jdbc/sharedsetup/default" > global="jdbc/sharedsetup/test"/> > <ResourceLink name="jdbc/sharedsetup/dev" > global="jdbc/sharedsetup/dev"/> > <ResourceLink name="jdbc/sharedsetup/test" > global="jdbc/sharedsetup/test"/> > </Context> > > failure logged when application attempts to start > ===================================================== > 2003-11-07 11:00:46 StandardContext[/sharedsetup]: Resources start failed: > java.lang.IllegalArgumentException: Document base ..\webapps\sharedsetup > does not exist or is not a readable directory > at > org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:19 > 3) > at > org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java > :3342) > at > org.apache.catalina.core.StandardContext.start(StandardContext.java:3472) > at > org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8 > 21) > at > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) > at > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) > at > org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer. > java:700) > at java.lang.reflect.Method.invoke(Native Method) > at > org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252) > at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:260) > at org.apache.commons.digester.Rule.end(Rule.java:276) > at > org.apache.commons.digester.Digester.endElement(Digester.java:1064) > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown > Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc > her.dispatch(Unknown Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown > Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) > at org.apache.commons.digester.Digester.parse(Digester.java:1562) > at > org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j > ava:385) > at > org.apache.catalina.core.StandardHost.install(StandardHost.java:803) > at > org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:442 > ) > at > org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:399) > at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718) > at > org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358) > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor > t.java:166) > at > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196) > at > org.apache.catalina.core.StandardHost.start(StandardHost.java:738) > at > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) > at > org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) > at > org.apache.catalina.core.StandardService.start(StandardService.java:497) > at > org.apache.catalina.core.StandardServer.start(StandardServer.java:2190) > at org.apache.catalina.startup.Catalina.start(Catalina.java:512) > at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) > at org.apache.catalina.startup.Catalina.process(Catalina.java:180) > at java.lang.reflect.Method.invoke(Native Method) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) > 2003-11-07 11:00:46 StandardContext[/sharedsetup]: Context startup failed > due to previous errors > > > > **************************************************************************** > This email may contain confidential material. > If you were not an intended recipient, > Please notify the sender and delete all copies. > We may monitor email to and from our network. > **************************************************************************** > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **************************************************************************** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. **************************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]