You've just described, perfectly, the behavior of Tomcat-4.1.xx. If you want different behavior, use Tomcat-5.x.xx. The only difference being that you wouldn't put the context configuration file in the webapps directory, you put it in conf/Catalina/[...host...] and refer to SHAREDSETUP.war instead of SHAREDSETUP. The app will be "exploded" to SHAREDSETUP anyway and deployed from there, even though you point at the .war file in the docBase attribute.
Jake
At 11:47 AM 11/7/2003 -0600, you wrote:
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]
