Here's what I do:

  <!-- Global JNDI resources -->
  <GlobalNamingResources>
    <Resource name="jdbc/GlobalRealmDB"
              auth="Container"
              type="javax.sql.DataSource"
       description="blah">
    </Resource>
    <ResourceParams name="jdbc/GlobalRealmDB">
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      etc


and then in the <Host... I have the contexts, e.g.:


        <Context path="/linklib" docBase="linklib"
          debug="5" reloadable="true" crossContext="true">
          <Manager pathname=""/>
          <Logger className="org.apache.catalina.logger.FileLogger"
            prefix="localhost_linklib_log." suffix=".txt"
            timestamp="true"/>
          <ResourceLink name="jdbc/RealmDB"
            global="jdbc/GlobalRealmDB"
            type="javax.sql.DataSource"/>


On 09/15/2003 08:15 PM Paul wrote:
thanks for the response.  I think you are suggesting an approach i have
already tried, with confusing results (confusing in that it worked for one
web app, but not another!), namely, setting up a global resource under the
following server.xml tag:   <GlobalNamingResources>

the actual resource tag i use is as follows:  <Resource name="jdbc/eplResrc"
auth="Container" type="javax.sql.DataSource"/>

and then the resource link is specified as follows:
<Context path="/test" docBase="test" debug="5" reloadable="true"
crossContext="true">

<ResourceLink name="jdbc/eplResrc" global="jdbc/eplResrc"
type="javax.sql.DataSource"/>

</Context>

Notice that the values for the "name" and "global" parameter in the
ResourceLink tag are the same.  I notice that in your example they are
different.  Where does the "global" value get defined?


----- Original Message ----- From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Monday, September 15, 2003 1:36 PM
Subject: Re: setup of global resources, dbcp, mail, etc.




The tricky bit is to remember to put a reference to the global-resource
in the contexts which want to use it:

          <ResourceLink name="jdbc/RealmDB"
            global="jdbc/GlobalRealmDB"
            type="javax.sql.DataSource"/>

Adam

On 09/15/2003 07:03 PM Paul wrote:

has anyone been successful setting up a global resource under Tomcat

4.1, jdk 1.4 that is accessible to all webapps? If so, please describe how you configured tomcat.

thanks, paul lomack


-- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9


--------------------------------------------------------------------- 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]



-- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to