tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sry...@jsrsys.com
Subject Re: Fw: Tomcat 5.0.28 jdbc error "Name jdbc is not bound in this Context" on WindowsXP.
Date Tue, 22 Jan 2013 04:32:13 GMT
> Why don't you show us what you've got, and we can suggest some
> improvements?
Thank you.      This one is in localhost:
<Context path="/">  <!-- put this one in localhost   add path because of 
"Context path is required" error-->
<ResourceLink name="jdbc/MySql" type="javax.sql.DataSource"
             global="jdbc/MySqlDB" />

<!-- below all copied from ...conf context.xml file-->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource name="jdbc/MySql" auth="Container" type="javax.sql.DataSource"
  url="jdbc:mysql://localhost/autoReconnect=true"
     factory="org.apache.commons.dbcp.BasicDataSourceFactory"
  driverClassName="com.mysql.jdbc.Driver"
  password="******" username="jsrsys"
     maxWait="10000"   maxActive="200"  maxIdle="5"
   removeAbandoned="true" removeAbandonedTimeout="300" logAbandoned="true"
  validationQuery="SELECT 1" testOnBorrow="true"
 />
</Context>


Below is near top of server.xml in conf directory
 <!-- Global JNDI resources -->
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <Resource auth="Container" description="User database that can be 
updated and saved"
              name="UserDatabase" type="org.apache.catalina.UserDatabase"/>
    <Resource auth="Container" name="jdbc/MySqlDB" 
type="javax.sql.DataSource"/>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>
    <ResourceParams name="jdbc/MySqlDB">
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:mysql://localhost/autoReconnect=true</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>********</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>10000</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>3</value> <!--  so will fail early if sql.close() missing -->
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>com.mysql.jdbc.Driver</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>jsrsys</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>5</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources> 


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


Mime
View raw message