[mule-jira] Created: (MULE-4589) java.lang.IllegalStateException: Phase 'start' has already been executed

View: New views
4 Messages — Rating Filter:   Alert me  

[mule-jira] Created: (MULE-4589) java.lang.IllegalStateException: Phase 'start' has already been executed

by JIRA no-reply@mulesource.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 java.lang.IllegalStateException: Phase 'start' has already been executed
-------------------------------------------------------------------------

                 Key: MULE-4589
                 URL: http://www.mulesource.org/jira/browse/MULE-4589
             Project: Mule
          Issue Type: Bug
          Components: Core: Concurrency / Threading
    Affects Versions: 2.2.2 (EE only)
            Reporter: Francis Upton


I am using Mule ESB EE 2.2.2 and testing it using Junit tests with the FunctionalTestCase mechanism (that is my Junit tests all subclass from this). I get this except intermittently when running the tests.

java.lang.IllegalStateException: Phase 'start' has already been executed
at org.mule.lifecycle.GenericLifecycleManager.checkPhase(GenericLifecycleManager.java:174)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:159)
at org.mule.tck.AbstractMuleTestCase.setUp(AbstractMuleTestCase.java:409)
at org.mule.tck.AbstractMuleTestCase.runBare(AbstractMuleTestCase.java:291)
at org.mule.tck.AbstractMuleTestCase.run(AbstractMuleTestCase.java:270)

The fix to the problem is below.  It turns out that when I run the test cases it starts my configuration which includes several examples.  The way the OSDT examples work is that they are started in a different thread; because of the thread execution order the start intermittently fails because of the problem below.


In DefaultMuleClient.start():

    public synchronized void start() throws MuleException
    {
        lifecycleManager.checkPhase(Startable.PHASE_NAME);
        if (!isStarted())
        {
            if (getSecurityManager() == null)
            {
                throw new MuleRuntimeException(CoreMessages.objectIsNull("securityManager"));
            }
            if (getQueueManager() == null)
            {
                throw new MuleRuntimeException(CoreMessages.objectIsNull("queueManager"));
            }
           ....

The lifecycleManager.checkPhase() call should be inside of the !isStarted().

What's happening in my tests is that I spawn a thread that starts up MuleClients which causes a the MuleContext to start.  Remembering the stack trace in the previous message, this thread is called by the setUp() method in the AbstractMuleTestCase.  If the thread starts and gets into the synchronized block of the above start() method, then the main thread will block there while the lengthy startup process is happening.  Then the main thread will die because it will fail the checkPhase() call.


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.mulesource.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[mule-jira] Commented: (MULE-4589) java.lang.IllegalStateException: Phase 'start' has already been executed

by JIRA no-reply@mulesource.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://www.mulesource.org/jira/browse/MULE-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32219#action_32219 ]

Francis Upton commented on MULE-4589:
-------------------------------------

See also MULE-4590.

>  java.lang.IllegalStateException: Phase 'start' has already been executed
> -------------------------------------------------------------------------
>
>                 Key: MULE-4589
>                 URL: http://www.mulesource.org/jira/browse/MULE-4589
>             Project: Mule
>          Issue Type: Bug
>          Components: Core: Concurrency / Threading
>    Affects Versions: 2.2.2 (EE only)
>            Reporter: Francis Upton
>
> I am using Mule ESB EE 2.2.2 and testing it using Junit tests with the FunctionalTestCase mechanism (that is my Junit tests all subclass from this). I get this except intermittently when running the tests.
> java.lang.IllegalStateException: Phase 'start' has already been executed
> at org.mule.lifecycle.GenericLifecycleManager.checkPhase(GenericLifecycleManager.java:174)
> at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:159)
> at org.mule.tck.AbstractMuleTestCase.setUp(AbstractMuleTestCase.java:409)
> at org.mule.tck.AbstractMuleTestCase.runBare(AbstractMuleTestCase.java:291)
> at org.mule.tck.AbstractMuleTestCase.run(AbstractMuleTestCase.java:270)
> The fix to the problem is below.  It turns out that when I run the test cases it starts my configuration which includes several examples.  The way the OSDT examples work is that they are started in a different thread; because of the thread execution order the start intermittently fails because of the problem below.
> In DefaultMuleClient.start():
>     public synchronized void start() throws MuleException
>     {
>         lifecycleManager.checkPhase(Startable.PHASE_NAME);
>         if (!isStarted())
>         {
>             if (getSecurityManager() == null)
>             {
>                 throw new MuleRuntimeException(CoreMessages.objectIsNull("securityManager"));
>             }
>             if (getQueueManager() == null)
>             {
>                 throw new MuleRuntimeException(CoreMessages.objectIsNull("queueManager"));
>             }
>            ....
> The lifecycleManager.checkPhase() call should be inside of the !isStarted().
> What's happening in my tests is that I spawn a thread that starts up MuleClients which causes a the MuleContext to start.  Remembering the stack trace in the previous message, this thread is called by the setUp() method in the AbstractMuleTestCase.  If the thread starts and gets into the synchronized block of the above start() method, then the main thread will block there while the lengthy startup process is happening.  Then the main thread will die because it will fail the checkPhase() call.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.mulesource.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[mule-jira] Closed: (MULE-4589) java.lang.IllegalStateException: Phase 'start' has already been executed

by JIRA no-reply@mulesource.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://www.mulesource.org/jira/browse/MULE-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Feist closed MULE-4589.
------------------------------

    Resolution: Fixed

>  java.lang.IllegalStateException: Phase 'start' has already been executed
> -------------------------------------------------------------------------
>
>                 Key: MULE-4589
>                 URL: http://www.mulesource.org/jira/browse/MULE-4589
>             Project: Mule
>          Issue Type: Bug
>          Components: Core: Concurrency / Threading
>    Affects Versions: 2.2.2 (EE only)
>            Reporter: Francis Upton
>            Assignee: Daniel Feist
>            Priority: Major
>             Fix For: 2.1.4 (EE only), ITR25, 2.2.3 (EE only)
>
>
> I am using Mule ESB EE 2.2.2 and testing it using Junit tests with the FunctionalTestCase mechanism (that is my Junit tests all subclass from this). I get this except intermittently when running the tests.
> java.lang.IllegalStateException: Phase 'start' has already been executed
> at org.mule.lifecycle.GenericLifecycleManager.checkPhase(GenericLifecycleManager.java:174)
> at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:159)
> at org.mule.tck.AbstractMuleTestCase.setUp(AbstractMuleTestCase.java:409)
> at org.mule.tck.AbstractMuleTestCase.runBare(AbstractMuleTestCase.java:291)
> at org.mule.tck.AbstractMuleTestCase.run(AbstractMuleTestCase.java:270)
> The fix to the problem is below.  It turns out that when I run the test cases it starts my configuration which includes several examples.  The way the OSDT examples work is that they are started in a different thread; because of the thread execution order the start intermittently fails because of the problem below.
> In DefaultMuleClient.start():
>     public synchronized void start() throws MuleException
>     {
>         lifecycleManager.checkPhase(Startable.PHASE_NAME);
>         if (!isStarted())
>         {
>             if (getSecurityManager() == null)
>             {
>                 throw new MuleRuntimeException(CoreMessages.objectIsNull("securityManager"));
>             }
>             if (getQueueManager() == null)
>             {
>                 throw new MuleRuntimeException(CoreMessages.objectIsNull("queueManager"));
>             }
>            ....
> The lifecycleManager.checkPhase() call should be inside of the !isStarted().
> What's happening in my tests is that I spawn a thread that starts up MuleClients which causes a the MuleContext to start.  Remembering the stack trace in the previous message, this thread is called by the setUp() method in the AbstractMuleTestCase.  If the thread starts and gets into the synchronized block of the above start() method, then the main thread will block there while the lengthy startup process is happening.  Then the main thread will die because it will fail the checkPhase() call.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.mulesource.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[mule-jira] Commented: (MULE-4589) java.lang.IllegalStateException: Phase 'start' has already been executed

by JIRA no-reply@mulesource.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://www.mulesource.org/jira/browse/MULE-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32261#action_32261 ]

Daniel Feist commented on MULE-4589:
------------------------------------

2.1.x: http://fisheye.codehaus.org/changelog/mule/branches/mule-2.1.x?cs=15959
2.2.x: http://fisheye.codehaus.org/changelog/mule/branches/mule-2.2.x?cs=15960
3.x: http://fisheye.codehaus.org/changelog/mule/branches/mule-3.x?cs=15961

>  java.lang.IllegalStateException: Phase 'start' has already been executed
> -------------------------------------------------------------------------
>
>                 Key: MULE-4589
>                 URL: http://www.mulesource.org/jira/browse/MULE-4589
>             Project: Mule
>          Issue Type: Bug
>          Components: Core: Concurrency / Threading
>    Affects Versions: 2.2.2 (EE only)
>            Reporter: Francis Upton
>            Assignee: Daniel Feist
>            Priority: Major
>             Fix For: 2.1.4 (EE only), ITR25, 2.2.3 (EE only)
>
>
> I am using Mule ESB EE 2.2.2 and testing it using Junit tests with the FunctionalTestCase mechanism (that is my Junit tests all subclass from this). I get this except intermittently when running the tests.
> java.lang.IllegalStateException: Phase 'start' has already been executed
> at org.mule.lifecycle.GenericLifecycleManager.checkPhase(GenericLifecycleManager.java:174)
> at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:159)
> at org.mule.tck.AbstractMuleTestCase.setUp(AbstractMuleTestCase.java:409)
> at org.mule.tck.AbstractMuleTestCase.runBare(AbstractMuleTestCase.java:291)
> at org.mule.tck.AbstractMuleTestCase.run(AbstractMuleTestCase.java:270)
> The fix to the problem is below.  It turns out that when I run the test cases it starts my configuration which includes several examples.  The way the OSDT examples work is that they are started in a different thread; because of the thread execution order the start intermittently fails because of the problem below.
> In DefaultMuleClient.start():
>     public synchronized void start() throws MuleException
>     {
>         lifecycleManager.checkPhase(Startable.PHASE_NAME);
>         if (!isStarted())
>         {
>             if (getSecurityManager() == null)
>             {
>                 throw new MuleRuntimeException(CoreMessages.objectIsNull("securityManager"));
>             }
>             if (getQueueManager() == null)
>             {
>                 throw new MuleRuntimeException(CoreMessages.objectIsNull("queueManager"));
>             }
>            ....
> The lifecycleManager.checkPhase() call should be inside of the !isStarted().
> What's happening in my tests is that I spawn a thread that starts up MuleClients which causes a the MuleContext to start.  Remembering the stack trace in the previous message, this thread is called by the setUp() method in the AbstractMuleTestCase.  If the thread starts and gets into the synchronized block of the above start() method, then the main thread will block there while the lengthy startup process is happening.  Then the main thread will die because it will fail the checkPhase() call.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.mulesource.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email