Re: context.xml created by Ant not discovered by Tomcat

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

Re: context.xml created by Ant not discovered by Tomcat

Lynn Hollerman
Matt Galvin <[hidden email]> wrote:

> Yes, there is, I usually put them in:
>
> $CATALINA_HOME/conf/Catalina/localhost/myapp.xml
>
> Could you post the contents of your context file? Maybe something
> needs to be tweak possibly.

Here is context.xml...

<Context path="/xxxxxx" docBase="xxxxxx" crossContext="true">

   <Resource name="jdbc/xxxxxxDb" auth="Container" type="javax.sql.DataSource"/>

   <ResourceParams name="jdbc/xxxxxxDb">
 
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>

     <!-- Maximum number of dB connections in pool. Set to 0 for no limit.-->
     <!-- Maximum number of idle dB connections to retain in pool. Set to 0 for
no limit.-->
     <!-- Maximum time to wait for a dB connection to become available in ms, in
this example 10 seconds. An Exception is thrown if this timeout is exceeded.
Set to -1 to wait indefinitely. -->
     <parameter><name>maxActive</name><value>100</value></parameter>
     <parameter><name>maxIdle</name><value>30</value></parameter>
     <parameter><name>maxWait</name><value>10000</value></parameter>

     <!-- JDBC driver configuration  -->
 
<parameter><name>driverClassName</name><value>com.mysql.jdbc.Driver</value></parameter>
 
<parameter><name>url</name><value>jdbc:mysql://localhost/xxxxxxDb</value></parameter>
     <parameter><name>username</name><value>xxxxxx</value></parameter>
     <parameter><name>password</name><value>xxxxxx</value></parameter>

   </ResourceParams>

     <!-- Disables restart persistence of sessions -->
     <Manager pathname=""/>

</Context>

As you can see, I'm using a MySQL database. Also, apparently I DON'T have this
problem when using Tomcat 5.5.9 (at first, it appeared that I did have the
problem with 5.5.9, but after a restart of Tomcat and a reboot of the machine,
it worked as desired, but I don't think I should've needed to reboot) - and I
notice that the default Balancer app seems to use the same thing. So perhaps
this is a 5.5.x-only thing?

Thanks!

--
Lynn Hollerman.

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

Reply | Threaded
Open this post in threaded view
|

Re: context.xml created by Ant not discovered by Tomcat

Matt Galvin
> Here is context.xml...
>
> <Context path="/xxxxxx" docBase="xxxxxx" crossContext="true">
>
>    <Resource name="jdbc/xxxxxxDb" auth="Container" type="javax.sql.DataSource"/>
>
>    <ResourceParams name="jdbc/xxxxxxDb">
>
> <parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourceFactory</value></parameter>
>
>      <!-- Maximum number of dB connections in pool. Set to 0 for no limit.-->
>      <!-- Maximum number of idle dB connections to retain in pool. Set to 0 for
> no limit.-->
>      <!-- Maximum time to wait for a dB connection to become available in ms, in
> this example 10 seconds. An Exception is thrown if this timeout is exceeded.
> Set to -1 to wait indefinitely. -->
>      <parameter><name>maxActive</name><value>100</value></parameter>
>      <parameter><name>maxIdle</name><value>30</value></parameter>
>      <parameter><name>maxWait</name><value>10000</value></parameter>
>
>      <!-- JDBC driver configuration  -->
>
> <parameter><name>driverClassName</name><value>com.mysql.jdbc.Driver</value></parameter>
>
> <parameter><name>url</name><value>jdbc:mysql://localhost/xxxxxxDb</value></parameter>
>      <parameter><name>username</name><value>xxxxxx</value></parameter>
>      <parameter><name>password</name><value>xxxxxx</value></parameter>
>
>    </ResourceParams>
>
>      <!-- Disables restart persistence of sessions -->
>      <Manager pathname=""/>
>
> </Context>

Well, the only thing I notice is that according to the tomcat 5.5.x docs at:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html

the dbcp resource take this for now:

--- snip ---
<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="10000"
               username="javauser" password="javadude"
driverClassName="com.mysql.jdbc.Driver"
               url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/>
--- snip ---

You may want to try it this way.

Matt

> --
> Lynn Hollerman.
>

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