tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim de Boer" <timdeb...@iinet.net.au>
Subject Problems with InitialContext and threads
Date Mon, 07 Jun 2004 03:32:58 GMT
Hi All

I have a problem with my Tomcat 4.1.24 installation which I'm hoping someone may have an answer
for. I have a little quartz scheduler running in Tomcat which I start with a servlet (previously
started with a listener but switched to servlet in the hope it might fix things - both ways
produced the same error).

When I start Tomcat up in my development mode which has the configuration shown below all
works fine. When I start up in production mode however there seems to be problems with *some*
Quartz scheduler threads picking up the initialContext???

I have a little utility for printing out the name tree and the output varies between quartz
threads??

Here is an example of the output
==============================================================================================

DEBUG[DefaultQuartzScheduler_Worker-4] HibernateUtils:79 - Beginning transaction
ERROR[DefaultQuartzScheduler_Worker-2] TomcatUtils:46 - javax.naming.NameNotFoundException:
Name java: is not bound in this Context
DEBUG[DefaultQuartzScheduler_Worker-6] TomcatUtils:42 - >>>>>>>>>>>>>>>>>>>>>>>>
PRINTING NAME TREE

>>>>>>>>>>>>>>>>>>>>>>>>
FINISHED PRINTING NAME TREE
DEBUG[DefaultQuartzScheduler_Worker-7] HibernateUtils:79 - Beginning transaction
DEBUG[DefaultQuartzScheduler_Worker-2] HibernateUtils:79 - Beginning transaction
DEBUG[DefaultQuartzScheduler_Worker-8] HibernateUtils:79 - Beginning transaction
DEBUG[DefaultQuartzScheduler_Worker-5] HibernateUtils:79 - Beginning transaction
ERROR[DefaultQuartzScheduler_Worker-9] TomcatUtils:40 - javax.naming.NameNotFoundException:
Name java: is not bound in this Context
DEBUG[DefaultQuartzScheduler_Worker-9] HibernateUtils:79 - Beginning transaction
Sending Mail!
Sending Mail!
Sending Mail!
Sending Mail!
DEBUG[DefaultQuartzScheduler_Worker-1] TomcatUtils:48 - >>>>>>>>>>>>>>>>>>>>>>>>
PRINTING NAME TREE

>>>>>>>>>>>>>>>>>>>>>>>>
FINISHED PRINTING NAME TREE
DEBUG[DefaultQuartzScheduler_Worker-6] HibernateUtils:79 - Beginning transaction
Sending Mail!
DEBUG[DefaultQuartzScheduler_Worker-0] TomcatUtils:42 - >>>>>>>>>>>>>>>>>>>>>>>>
PRINTING NAME TREE

>>>>>>>>>>>>>>>>>>>>>>>>
FINISHED PRINTING NAME TREE
Sending Mail!
Sending Mail!
DEBUG[DefaultQuartzScheduler_Worker-2] TomcatUtils:42 - >>>>>>>>>>>>>>>>>>>>>>>>
PRINTING NAME TREE
-comp
--UserTransaction
Couldn't traverse any part of name java:/comp/\UserTransaction: Name is not bound to a Context
--env
---jdbc
----ln
Couldn't traverse any part of name java:/comp//env//jdbc/\ln: Name is not bound to a Context
--Resources
---WEB-INF
----classes
(..and so on)


Here is my production config...
==============================================================================================

<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"/>-->

  <Service name="Tomcat-Standalone">

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="80" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="100" debug="0" connectionTimeout="20000"
               useURIValidationHack="false" disableUploadTimeout="true" />

    <Engine name="Standalone" defaultHost="localhost" debug="0">
        <Host name="localhost" debug="0" unpackWARs="false">
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="..\logs"  prefix="tomcat_" suffix=".log"
            timestamp="true"/>
        <Context 
                path="/ln" 
                docBase="LuckyNumbers" 
                debug="10"
        >
        <Resource name="jdbc/ln" scope="Shareable" type="javax.sql.DataSource"/>
        <ResourceParams name="jdbc/ln">
            <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <!-- DBCP database connection settings -->
            <parameter>
                <name>url</name>
                <value>jdbc:hsqldb:hsql://localhost</value>
            </parameter>
            <parameter>
                <name>driverClassName</name>
                <value>org.hsqldb.jdbcDriver</value>
            </parameter>
            <parameter>
                <name>username</name>
                <value>sa</value>
            </parameter>
            <parameter>
                <name>password</name>
                <value></value>
            </parameter>
            <!-- DBCP connection pooling options -->
            <parameter>
                <name>maxWait</name>
                <value>3000</value>
            </parameter>
            <parameter>
                <name>maxIdle</name>
                <value>100</value>
            </parameter>
            <parameter>
                <name>maxActive</name>
                <value>10</value>
            </parameter>
        </ResourceParams>            
           </Context>
        </Host>

    </Engine>
  </Service>
</Server>

Here is my development config...
==============================================================================================
<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"/>-->

  <Service name="Tomcat-Standalone">

    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="80" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="100" debug="0" connectionTimeout="20000"
               useURIValidationHack="false" disableUploadTimeout="true" />

    <Engine name="Standalone" defaultHost="localhost" debug="0">
        <Alias>Tim</Alias>
        <Host name="localhost" debug="0" unpackWARs="true" autoDeploy="true" >
            <Logger 
                className="org.apache.catalina.logger.SystemOutLogger" 
                timestamp="false"
            />
            <Context 
                path="/ln" 
                docBase="*project.dir*web" 
                reloadable="true" 
                debug="10"
            >
        <Resource name="jdbc/ln" scope="Shareable" type="javax.sql.DataSource"/>
        <ResourceParams name="jdbc/ln">
            <parameter>
                <name>factory</name>
                <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
            </parameter>
            <!-- DBCP database connection settings -->
            <parameter>
                <name>url</name>
                <value>jdbc:hsqldb:hsql://localhost</value>
            </parameter>
            <parameter>
                <name>driverClassName</name>
                <value>org.hsqldb.jdbcDriver</value>
            </parameter>
            <parameter>
                <name>username</name>
                <value>sa</value>
            </parameter>
            <parameter>
                <name>password</name>
                <value></value>
            </parameter>
            <!-- DBCP connection pooling options -->
            <parameter>
                <name>maxWait</name>
                <value>3000</value>
            </parameter>
            <parameter>
                <name>maxIdle</name>
                <value>100</value>
            </parameter>
            <parameter>
                <name>maxActive</name>
                <value>10</value>
            </parameter>
        </ResourceParams>            
           </Context>
        </Host>

    </Engine>
    
    
    
  </Service>
</Server>



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message