conf is: Program Files/Apache Software Foundation/Tomcat5.0/conf   (where
server xml resides).

When I put context.xml in that directory, it seemed to be ignored.  I did
some experimenting moving it around and when I put it in:  Program
Files/Apache Software Foundation/Tomcat5.0/conf/Catalina/localhost
the console log in Eclipse showed it was being processed AND gave me the
path error.

The max active 3 is for my development environment only so I will catch my
failure to do an sql.close() during testing on the development machine.  The
production machine has 200.

Yes, I want one shared connection pool.  Security is provided via
application code, and I personally code ALL the apps.
each app has it's own database.

I have made all the changes you suggested below and still get the error.
I have deleted the context.xml in localhost.  I attach the two files that
are now both in ONLY the
Program Files/Apache Software Foundation/Tomcat5.0/conf   directory.

The exception stack is:
:*WARNING*Connection to jdbc/MySql:: connect Other exception: Name jdbc is not bound in this Context 2013-01-22 12:42:00:Stack(6)=org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) 2013-01-22 12:42:00:Stack(5)=org.apache.jsp.SQLRep_jsp._jspService(SQLRep_jsp.java:610)
2013-01-22 12:42:00:Stack(4)=com.jsrsys.web.JsrSQL.(JsrSQL.java:42)
2013-01-22 12:42:00:Stack(3)=com.jsrsys.web.JsrSQL.setDataBaseName(JsrSQL.java:86)
2013-01-22 12:42:00:Stack(2)=com.jsrsys.web.JsrSQL.connect(JsrSQL.java:504)
2013-01-22 12:42:00:Stack(1)=org.apache.naming.NamingContext.lookup(NamingContext.java:151) 2013-01-22 12:42:00:Stack(0)=org.apache.naming.NamingContext.lookup(NamingContext.java:768)
2013-01-22 12:42:00:JsrSQL: Context cast successfull

SQLRep is the jsp page, JsrSQL is my class that handles all SQL. The base errors seems to be the NamingContextLookup error from Apache tomcat.
<?xml version="1.0" encoding="UTF-8"?>
<!-- The contents of this file will be loaded for each web application -->
<Context>
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource name="jdbc/MySql" auth="Container" type="javax.sql.DataSource"
	 url="jdbc:mysql://localhost/autoReconnect=true"
     driverClassName="com.mysql.jdbc.Driver"
	 password="jsrsys" username="jsrsys"
     maxWait="10000"   maxActive="200"  maxIdle="5"
 	 removeAbandoned="true" removeAbandonedTimeout="300" logAbandoned="true"
	 validationQuery="SELECT 1" testOnBorrow="true"
	/>  
</Context>
<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
            debug="0"/>
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
            debug="0"/>

  <!-- Global JNDI resources -->
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
	
    <!--  remove per Chris
    <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"/>
	<!--  remove per Chris
    <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>jsrsys</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>

  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Catalina">

    <Connector 
port="8080"               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               debug="0" connectionTimeout="20000" 
               disableUploadTimeout="true" />

    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" 
               enableLookups="false" redirectPort="8443" debug="0"
               protocol="AJP/1.3" />

         
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost" debug="0">

      <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="catalina_log." suffix=".txt"
              timestamp="true"/>
<!--  remove per Chris
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                 debug="0" resourceName="UserDatabase"/>
-->
 
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

 
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
            timestamp="true"/>

      </Host>

    </Engine>

  </Service>

</Server>

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

Reply via email to