tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Gregory" <Rob.Greg...@ibsolutions.com>
Subject RE: Single webapp multiple contexts
Date Tue, 09 Nov 2010 16:43:45 GMT
Just to expand on this a little. I have previously had something working
but that was on Tomcat 5.5.9, The same trick no longer seems to work
under 6.0.29. 

I basically created a context like 

<Context swallowOutput="false" reloadable="false" useHttpOnly="true"
path="/B" 
	docBase="${catalina.home}/webapps/myapp" />

which used an already deployed copy of our webapp. This did work under
5.5.9 but fails with the following error under 6.0.29. Has this
functionality changed and if so is this sort of trick not a good idea?

INFO: Deploying configuration descriptor A.xml
09-Nov-2010 16:37:21 org.apache.catalina.startup.HostConfig
deployDescriptor
WARNING: A docBase C:\intweb\0600\webapps\myapp inside the host appBase
has be
en specified, and will be ignored
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
C:\intweb\0600\webapps\A does
not exist or is not a readable directory
        at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.
java:142)
        at
org.apache.catalina.core.StandardContext.resourcesStart(StandardConte
xt.java:4249)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
418)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
1)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)

        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
va:637)
        at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
ava:563)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498
)
        at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:321)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445
)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710
)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
SEVERE: Context [/A] startup failed due to previous errors

Thanks
Rob


> From: Rob Gregory [mailto:Rob.Gregory@ibsolutions.com]
> Sent: 09 November 2010 16:22
> To: Tomcat Users List
> Subject: Single webapp multiple contexts
> 
> Hello Tomcat Users,
> 
> 
> 
> I am trying to create multiple 'dynamic' contexts using just a single
> code base. For example we currently deploy a webapps within a context
of
> let's say 'A'. This listens quite happily for requests coming in the
> form of http://localhost/A/index.htm. What I need to be able to do is
> have this same code base also listen for requests in the form of
> http://localhost/B/index.htm. I have played with using 'fake'
> context.xml e.g.
> 
> 
> 
> A.xml = <Context useHttpOnly="true"  docBase="C:/0600/ieseries.war"
> path="/A" />
> 
> B.xml = <Context useHttpOnly="true"  docBase="C:/0600/ieseries.war"
> path="/B" />
> 
> 
> 
> This seems to work but the war is expanded into both contexts and what
I
> really need is a single code base preferably without the requirement
of
> using a .war file. I have looked at virtual hosts but this seems to
> involve changing the host name which is also not what I am trying to
> achieve.
> 
> 
> 
> Using Tomcat 6.0.29 under Java(TM) SE Runtime Environment (build
> 1.6.0_14-b08). CATALINA_HOME is C:/0600.
> 
> 
> 
> Can anyone give me a gentle push in the right direction if this is at
> all possible.
> 
> 
> 
> Thanks in advance.
> 
> 
> 
> Rob
> 
> 
> 
> 


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


Mime
View raw message