tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51344] New: org.apache.catalina.startup.Embedded overrides Lifecycle incorrectly?
Date Wed, 08 Jun 2011 21:35:55 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51344

             Bug #: 51344
           Summary: org.apache.catalina.startup.Embedded overrides
                    Lifecycle incorrectly?
           Product: Tomcat 7
           Version: 7.0.12
          Platform: PC
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: jdeppe@vmware.com
    Classification: Unclassified


Not sure if this is a bug or just my mis-coding...

I've been using the Embedded component in Tomcat 6.0.29 for integration
testing. Something like this:

    server = new EmbeddedTomcat("/test", 7890, "JVM-1");
    PeerToPeerCacheLifecycleListener p2pListener = new
PeerToPeerCacheLifecycleListener();
    p2pListener.setProperty("mcast-port", "19991");
    server.getEmbedded().addLifecycleListener(p2pListener);
    sessionManager = new DeltaSessionManager();
    server.getRootContext().setManager(sessionManager);

Here the EmbeddedTomcat class is simply a wrapper for Embedded - I'm passing in
the context, port and 'JVM route' - nothing special. Then I add a listener
which should be the programmatic equivalent of having the following server.xml
snippet:

<Server>
    <Listener className="PeerToPeerCacheLifecycleListener"/>
</Server>

DeltaSessionManager performs custom session management and thus extends
ManagerBase and implements Lifecycle and SessionManager.

During the start of DeltaSessionManager I initialize the listener by doing

    this.lifecycle.fireLifecycleEvent(START_EVENT, null);

The listener picks up this event and starts.

All works nicely under Tomcat 6, but breaks under Tomcat 7.0.12. My initial
investigation shows that the LifecycleEvent, being fired, is not reaching the
Embedded component which is where the listener is registered.

Removing the overridden Lifecycle methods from Embedded (so that the Lifecyle
processing happens in LifecycleBase) seems to work as the triggered event then
reaches my listener.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message