You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by matador <ma...@yahoo.com> on 2005/10/06 05:27:58 UTC

virtual host doesn't load database content

ok so i define my connection pools etc in a context.xml for localhost:

C:\Tomcat 5.5\conf\Catalina\localhost\context.xml

and it works.

but when the site is accessed from the virtual host defined in server.xml, 
then the context.xml (deployed as described below) does not ever see the 
connection pools

i tried it as follows, no joy:

C:\Tomcat 5.5\conf\Catalina\struts.acme.com\context.xml
C:\Tomcat 5.5\conf\Catalina\struts.acme.com\context.xml.default
C:\Tomcat 5.5\conf\Catalina\struts.acme.com\struts.xml
C:\Tomcat 5.5\conf\Catalina\struts.acme.com\struts.acme.com.xml

only ever works from server.xml

is there a workaround?  i know im not the only one:
http://www.junlu.com/msg/187453.html


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


Re: virtual host doesn't load database content

Posted by matador <ma...@yahoo.com>.
matador <ma...@yahoo.com> wrote in
news:Xns96E6E48D82B9Amatador@80.91.229.5: 

> ok so i define my connection pools etc in a context.xml for localhost:
> 
> C:\Tomcat 5.5\conf\Catalina\localhost\context.xml
> 
> and it works.
> 
> but when the site is accessed from the virtual host defined in
> server.xml, then the context.xml (deployed as described below) does
> not ever see the connection pools
> 
> i tried it as follows, no joy:
> 
> C:\Tomcat 5.5\conf\Catalina\struts.acme.com\context.xml
> C:\Tomcat 5.5\conf\Catalina\struts.acme.com\context.xml.default
> C:\Tomcat 5.5\conf\Catalina\struts.acme.com\struts.xml
> C:\Tomcat 5.5\conf\Catalina\struts.acme.com\struts.acme.com.xml
> 
> only ever works from server.xml
> 
> is there a workaround?  i know im not the only one:
> http://www.junlu.com/msg/187453.html

got it to work:

here is how:
tomcat 5.5.9
windows

server.xml

    <Engine
        defaultHost="localhost"
        name="Catalina">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
      <Host
          appBase="webapps/acme"
          name="struts.acme.com">
        <Alias>struts.acme.com</Alias>
      </Host>
      <Host
          appBase="webapps"
          name="localhost">
      </Host>
    </Engine>


add this file:
C:\Tomcat 5.5\conf\Catalina\struts.acme.com\ROOT.xml 

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" antiResourceLocking="true" docBase="" 
reloadable="true" workDir="work\Catalina\struts.acme.com\_">

    <ResourceLink global="jdbc/...
    
    <Resource auth="Container" name="jdbc/...

    <WatchedResource>WEB-INF/web.xml....
    
</Context>


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