You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2011/07/25 23:40:38 UTC

DO NOT REPLY [Bug 51555] New: An invalid Lifecycle transition ([before_stop]) for component in state [INITIALIZED]: MapperListener

https://issues.apache.org/bugzilla/show_bug.cgi?id=51555

             Bug #: 51555
           Summary: An invalid Lifecycle transition ([before_stop]) for
                    component in state [INITIALIZED]: MapperListener
           Product: Tomcat 7
           Version: 7.0.19
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: knst.kolinko@gmail.com
    Classification: Unclassified


Created attachment 27313
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27313
TEST-org.apache.tomcat.util.net.TestXxxEndpoint.BIO.txt

While running TestXxxEndpoint test I observed the following error - see
attached log:

An invalid Lifecycle transition was attempted ([before_stop]) for component
[org.apache.catalina.connector.MapperListener@e3849c] in state [INITIALIZED]
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was
attempted ([before_stop]) for component
[org.apache.catalina.connector.MapperListener@e3849c] in state [INITIALIZED]
    at
org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:386)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:212)
    at org.apache.catalina.connector.Connector.stopInternal(Connector.java:973)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225)
    at
org.apache.tomcat.util.net.TestXxxEndpoint.testStartStopBindOnStart(TestXxxEndpoint.java:172)


The test case contains two tests.
The first one (on port 8001) succeeded, while the second one (on port 8002)
failed with "Address already in use: JVM_Bind". This failure to bind to 8002
was unexpected and does not occur during normal run.

While Tomcat was stopping after failed start, the above "invalid Lifecycle
transition" exception was thrown by MapperListener.


I was testing with BIO connector only, running a single test
(test.entry=org.apache.tomcat.util.net.TestXxxEndpoint).

I think that the cause of the startup failure was that I accidentally started
two copies of Ant in parallel. In Eclipse it happens if you double-click on
"Run External Tool" button.



Looking at o.a.catalina.connector.Connector#startInternal(), it does
 - protocolHandler.start();
 - mapperListener.start();

The logs show that protocolHandler.start() call failed. Thus
mapperListener.start() was not called.


This second test TestXxxEndpoint.testStartStopBindOnStart() runs with
"bindOnInit" property of connector set to "false". Thus binding failure did not
happen in init(), but occurred in start().

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


DO NOT REPLY [Bug 51555] An invalid Lifecycle transition ([before_stop]) for component in state [INITIALIZED]: MapperListener

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51555

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> 2011-07-25 23:54:44 UTC ---
A simple way to reproduce this:

1. Add bindOnInit="false" to HTTP connector in server.xml and remove AJP
connector.
2. Start an instance of Tomcat.
3. Try to start second instance of Tomcat. It fails with the same "invalid
transition" exception:

26.07.2011 3:50:09 org.apache.catalina.core.StandardService destroyInternal
SEVERE: standardService.connector.destroyfailed
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was
attempted ([before_destroy]) for component
[org.apache.catalina.connector.MapperListener@17779e3] in state [INITIALIZED]
    at
org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:386)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:278)
    at
org.apache.catalina.connector.Connector.destroyInternal(Connector.java:979)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:284)
    at
org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:578)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:284)
    at
org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:789)
    at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:284)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:695)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:655)

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


DO NOT REPLY [Bug 51555] An invalid Lifecycle transition ([before_stop]) for component in state [INITIALIZED]: MapperListener

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51555

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Mark Thomas <ma...@apache.org> 2011-07-26 08:25:57 UTC ---
Fixed in 7.0.x and will be included in 7.0.20 onwards.

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