At 09:55 AM 3/29/03 -0700, you wrote:
A couple of questions: How are you deploying the web app?

The web app is deployed as ROOT. The server.xml is:



<Context path="" docBase="my_app" debug="0"/>

The daemon thread is created and destroyed in the struts PlugIn interface. I have given the relevant code below. My application shows that the application is created both as root /_ and as /my_app. Could that be the cause? If so, what is the solution? I want the web app to come up when the url is called and don't want to have to call www.url.com/my_app. Thanks. This seems like it may be the source of the difficulty. See below.

Is the
daemon thread aware of the Servlet lifecycle?

I have observed that when deploying via the Tomcat manager, there are
cases where the web app is stopped and restarted erroneously.
Basically, it starts after a deploy, then within a few seconds it stops
and then restarts.  If this is happening and your daemon thread is not
Servlet lifecycle aware and does not stop when the ServletContext is
destroyed, then that daemon is what is pinning your web application and
therefore WebappClassLoader.


No code calls the daemon. The only mention of the PlugIn on the entire computer is in the struts-config, which says:

<plug-in className="com.michaelmcgrady.util.message.IpDaemon"/>

I originally had code that would create the daemon by calling a servlet from a browser. That created only one object. No problems! To make life easy (or possible) for the person purchasing the software, I wanted to auto-generate the daemon, and have tried the web.xml generation through a servlet and the struts-config.xml generation through the PlugIn interface. I do not have initialization other than through the PlugIn init method. My initialization is:

public void init(ActionServlet servlet, ApplicationConfig config) throws ServletException {
this.servlet = servlet;
thread = new Thread(this);
thread.setPriority(Thread.MIN_PRIORITY);
thread.start();
}


My destroy method, through the PlugIn, is:

    public void destroy() {
        Thread moribund = thread;
        thread = null;
        moribund.interrupt();
    }

The debug (on the first object being created) gives the following read-out:

ClassLoader Hash (20632381) Class Hash (30102190) -- In constructor: Sat Mar 29 09:31:07 PST 2003
Start of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:07 PST 2003
End of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:07 PST 2003


ClassLoader Hash (274614) Class Hash (7084674) -- In constructor: Sat Mar 29 09:31:34 PST 2003
Start of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:34 PST 2003
End of init(ActionServlet, ApplicationConfig): Sat Mar 29 09:31:34 PST 2003


The Thread object is static in this class. What do you think?

Micael



On Sat, 2003-03-29 at 00:48, Micael wrote:
> I have created a daemon which I want to startup when Tomcat is started
> up.  If I configure the daemon to be started with a servlet in web.xml or
> by using a PlugIn interface and struts-config.xml, I get two daemons
> running.  How I don't know.  If I don't start the daemon at startup but by
> tweaking a servlet after startup, where the servlet calls the daemon, then
> I don't get two daemons.  Does anyone have any idea how this is
> happening?  I am getting two classloaders of the same type, i.e. same type
> but different hashcodes.  Anyone know what is going on.  I am running
> Struts 1.1 and Tomcat 1.1.18.  I have asked this question in a few ways
> with no responses.  I can find nothing relevant in the archives.  They are
> both coming from the WebappClassLoader which has as a parent
> [EMAIL PROTECTED]
>
> Hopefully someone has some assistance, because I am somewhat at a
> loss.  This must have something to do with the launcher, but I don't know
> what.  I have tried to get some information for a week out of this
> list.  Not sure if no one is doing PlugIns, or why there is so little
> interest in this.
>
> The hashcodes I get for the classloaders are as follows:
>
>
> LOOP: ClassLoader.hashCode(): 728272 Class.hashCode(): 15612583   Check
> No.: 657) Fri Mar 28 22:47:17 PST 2003 END
>
>
> LOOP: ClassLoader.hashCode(): 20632381 Class.hashCode(): 10973446  Check
> No.: 659) Fri Mar 28 22:47:19 PST 2003 END
>
> The details on the classloaders are:
>
> LOOP: ClassLoader.toString(): WebappClassLoader
>    available:
>      Extension[org.apache.commons.beanutils, implementationVendor=Apache
> Software Foundation, implementationVersion=1.4-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.collections, implementationVendor=Apache
> Software Foundation, implementationVersion=2.0, specificationVendor=Apache
> Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.dbcp, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.digester, implementationVendor=Apache
> Software Foundation, implementationVersion=1.3-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[commons-lang, implementationVendor=Apache Software
> Foundation, implementationVersion=1.0-dev, specificationVendor=Apache
> Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.logging, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0.1-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.pool, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0, specificationVendor=Apache
> Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.resources, implementationVendor=Apache
> Software Foundation, implementationVersion=0.1-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.services, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[Struts Framework, implementationVendor=Apache Software
> Foundation, implementationVendorId=org.apache, implementationVersion=1.0,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[Components Framework, implementationVendor=Apache Software
> Foundation, implementationVendorId=org.apache, implementationVersion=0.7,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>    delegate: false
>    repositories:
>      /WEB-INF/classes/
>    required:
> ----------> Parent Classloader:
> StandardClassLoader
>    available:
>    delegate: true
>    repositories:
>    required:
> ----------> Parent Classloader:
> StandardClassLoader
>    available:
>      Extension[org.apache.tools.ant, implementationVendor=Apache Software
> Foundation, implementationVersion=1.5.1, specificationVendor=Apache
> Software Foundation, specificationVersion=1.5.1]
>      Extension[org.apache.commons.collections, implementationVendor=Apache
> Software Foundation, implementationVersion=1.1-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.logging, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0.2,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>    delegate: true
>    repositories:
>      file:C:\michaelmcgrady\tomcat\common\lib\ant.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\commons-collections.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\commons-logging-api.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\jasper-compiler.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\jasper-runtime.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\jdbc2_0-stdext.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\naming-common.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\naming-factory.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\naming-resources.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\servlet.jar
>    required:
> ----------> Parent Classloader:
> [EMAIL PROTECTED]
>
>
>   Class.toString(): class
> com.michaelmcgrady.util.message.messages.ip_address.IpDaemon/No.: 0) Fri
> Mar 28 22:57:36 PST 2003 END
>
>
> LOOP: ClassLoader.hashCode(): 12864392 Class.hashCode(): 32915800/No.: 0)
> Fri Mar 28 22:57:36 PST 2003 END
>
>
> LOOP: ClassLoader.toString(): WebappClassLoader
>    available:
>      Extension[org.apache.commons.beanutils, implementationVendor=Apache
> Software Foundation, implementationVersion=1.4-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.collections, implementationVendor=Apache
> Software Foundation, implementationVersion=2.0, specificationVendor=Apache
> Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.dbcp, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.digester, implementationVendor=Apache
> Software Foundation, implementationVersion=1.3-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[commons-lang, implementationVendor=Apache Software
> Foundation, implementationVersion=1.0-dev, specificationVendor=Apache
> Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.logging, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0.1-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.pool, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0, specificationVendor=Apache
> Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.resources, implementationVendor=Apache
> Software Foundation, implementationVersion=0.1-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.services, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[Struts Framework, implementationVendor=Apache Software
> Foundation, implementationVendorId=org.apache, implementationVersion=1.0,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[Components Framework, implementationVendor=Apache Software
> Foundation, implementationVendorId=org.apache, implementationVersion=0.7,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>    delegate: false
>    repositories:
>      /WEB-INF/classes/
>    required:
> ----------> Parent Classloader:
> StandardClassLoader
>    available:
>    delegate: true
>    repositories:
>    required:
> ----------> Parent Classloader:
> StandardClassLoader
>    available:
>      Extension[org.apache.tools.ant, implementationVendor=Apache Software
> Foundation, implementationVersion=1.5.1, specificationVendor=Apache
> Software Foundation, specificationVersion=1.5.1]
>      Extension[org.apache.commons.collections, implementationVendor=Apache
> Software Foundation, implementationVersion=1.1-dev,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>      Extension[org.apache.commons.logging, implementationVendor=Apache
> Software Foundation, implementationVersion=1.0.2,
> specificationVendor=Apache Software Foundation, specificationVersion=1.0]
>    delegate: true
>    repositories:
>      file:C:\michaelmcgrady\tomcat\common\lib\ant.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\commons-collections.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\commons-logging-api.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\jasper-compiler.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\jasper-runtime.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\jdbc2_0-stdext.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\naming-common.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\naming-factory.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\naming-resources.jar
>      file:C:\michaelmcgrady\tomcat\common\lib\servlet.jar
>    required:
> ----------> Parent Classloader:
> [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> 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]



LEGAL NOTICE


This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you



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



Reply via email to