<Environment> in Tomcat 5.0.28 not working with multiple tomcat services in server.xml

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

<Environment> in Tomcat 5.0.28 not working with multiple tomcat services in server.xml

Iannis Hanen
Hi,

 

I am back with some more questions. I have configured Tomcat to operate
with multiple services and engines (I have different services since I
need separate connector for different set of web applications). For some
web applications inside the host, I have specified some environment
entries. In the first service, everything works great. But in the second
service, I cannot access any of them. Is it a problem in Tomcat, or a
misconfiguration? Here is an outline of my server.xml file below.
Basically, "AttrName2" in the "foo2" context cannot be found. If I swap
the order of the services in server.xml, only the first service (on the
top) behaves properly.

 

Thanks,

Iannis

 

 

<Server ...>

  <Listener .../>

  <Listener .../>

 

<Service name="Service1">

 

    <Connector ... />

 

    <Engine name="Engine1" defaultHost="localhost" ...>

 

       <Logger .../>

 

      <Host name="localhost" ...>

 

      <DefaultContext>                        

             <Environment name="DefaultAttrName" type="java.lang.String"
value="Some default value"/>

     </DefaultContext>

                       

        <Context path="/foo" reloadable="false" docBase="C:\foo.war"
workDir="C:\ tomcat\work\foo">

            <Environment name="AttrName" type="java.lang.String"
value="myValueOK"/>

        </Context>

      </Host>

    </Engine>

  </Service>

 

  <Service name="Service2">

    <Connector  .../>

 

    <Engine name="Engine2" defaultHost="localhost" ...>

 

       <Logger .../>

 

      <Host name="localhost" ...>

        <Context path="/foo2" reloadable="false" docBase="C:\foo2.war"
workDir="C:\ tomcat\work\foo2">

            <Environment name="AttrName2" type="java.lang.String"
value="MyLostValue"/>

        </Context>

      </Host>

    </Engine>

  </Service>

</Server>

Reply | Threaded
Open this post in threaded view
|

Re: <Environment> in Tomcat 5.0.28 not working with multiple tomcat services in server.xml

Parsons Technical Services
You did specify a different IP for each connector? Else the 2nd one will
fail because the port is in use. Unless the ports on all connectors are
different.

Doug


----- Original Message -----
From: "Iannis Hanen" <[hidden email]>
To: <[hidden email]>
Cc: <[hidden email]>
Sent: Thursday, May 19, 2005 8:11 PM
Subject: <Environment> in Tomcat 5.0.28 not working with multiple tomcat
services in server.xml


Hi,



I am back with some more questions. I have configured Tomcat to operate
with multiple services and engines (I have different services since I
need separate connector for different set of web applications). For some
web applications inside the host, I have specified some environment
entries. In the first service, everything works great. But in the second
service, I cannot access any of them. Is it a problem in Tomcat, or a
misconfiguration? Here is an outline of my server.xml file below.
Basically, "AttrName2" in the "foo2" context cannot be found. If I swap
the order of the services in server.xml, only the first service (on the
top) behaves properly.



Thanks,

Iannis





<Server ...>

  <Listener .../>

  <Listener .../>



<Service name="Service1">



    <Connector ... />



    <Engine name="Engine1" defaultHost="localhost" ...>



       <Logger .../>



      <Host name="localhost" ...>



      <DefaultContext>

             <Environment name="DefaultAttrName" type="java.lang.String"
value="Some default value"/>

     </DefaultContext>



        <Context path="/foo" reloadable="false" docBase="C:\foo.war"
workDir="C:\ tomcat\work\foo">

            <Environment name="AttrName" type="java.lang.String"
value="myValueOK"/>

        </Context>

      </Host>

    </Engine>

  </Service>



  <Service name="Service2">

    <Connector  .../>



    <Engine name="Engine2" defaultHost="localhost" ...>



       <Logger .../>



      <Host name="localhost" ...>

        <Context path="/foo2" reloadable="false" docBase="C:\foo2.war"
workDir="C:\ tomcat\work\foo2">

            <Environment name="AttrName2" type="java.lang.String"
value="MyLostValue"/>

        </Context>

      </Host>

    </Engine>

  </Service>

</Server>




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]