JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-4589

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

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2.2 (EE only)
  • Fix Version/s: 3.0.0
  • Component/s: Core: Concurrency / Threading
  • Labels:
    None
  • User impact:
    High
  • Migration Impact:
    This fix did not make it to Mule 3.0
  • Similar Issues:
    None

Description

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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Francis Upton added a comment - 01/Nov/09 01:41 AM

See also MULE-4590.

Show
Francis Upton added a comment - 01/Nov/09 01:41 AM See also MULE-4590.
Dirk Olmes made changes - 02/Nov/09 11:07 AM
Field Original Value New Value
Fix Version/s ITR25 [ 10773 ]
Daniel Feist made changes - 03/Nov/09 09:20 AM
Assignee Daniel Feist [ dfeist ]
Daniel Feist made changes - 03/Nov/09 09:20 AM
Fix Version/s 2.1.4 (EE only) [ 10621 ]
Fix Version/s 2.2.3 (EE only) [ 10718 ]
Fix Version/s ITR25 [ 10773 ]
Priority To be reviewed [ 6 ] Major [ 3 ]
Daniel Feist made changes - 03/Nov/09 02:53 PM
Fix Version/s ITR25 [ 10773 ]
Daniel Feist made changes - 03/Nov/09 08:39 PM
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Daniel Feist
03/Nov/09 08:48 PM
View full commit
Merged revisions 15959 via svnmerge from https://svn.codehaus.org/mule/branches/mule-2.1.x ........ r15959 | dfeist | 2009-11-04 00:38:49 -0200 (Wed, 04 Nov 2009) | 1 line MULE-4589 java.lang.IllegalStateException: Phase 'start' has already been executed ........ git-svn-id: https://svn.codehaus.org/mule/branches/mule-2.2.x@15960 bf997673-6b11-0410-b953-e057580c5b09
mule-2.2.x
+27
-23
core/src/main/java/org/mule/DefaultMuleContext.java
+8
-18
core/src/main/java/org/mule/lifecycle/GenericLifecycleManager.java
+1
-
core/src/main/java/org/mule/lifecycle/phases/MuleContextInitialisePhase.java
Added
core/src/test/java/org/mule/context/MuleContextLifecycleTestCase.java
Hide
Permalink
Daniel Feist added a comment - 03/Nov/09 09:22 PM

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

Show
Daniel Feist added a comment - 03/Nov/09 09:22 PM 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
Hide
Permalink
Geetha Vallabhaneni added a comment - 22/Jul/10 04:34 PM

When deploying under TomCat, Mule3.0 (Milestone 4) throws the following exception:

a.lang.IllegalStateException: Already in lifecycle phase 'start', cannot fire
e same phase twice
at org.mule.lifecycle.LifecycleManagerSupport.checkPhase(LifecycleManage
pport.java:103)

It is the same bug as this one which was fixed in in 2.2.3:

http://www.mulesoft.org/jira/browse/MULE-4589

the synchronization primitives around the start routine have not made it into 3.0. Here is the thread with more information.

http://forums.mulesoft.org/message.jspa?messageID=10181#10181

Show
Geetha Vallabhaneni added a comment - 22/Jul/10 04:34 PM When deploying under TomCat, Mule3.0 (Milestone 4) throws the following exception: a.lang.IllegalStateException: Already in lifecycle phase 'start', cannot fire e same phase twice at org.mule.lifecycle.LifecycleManagerSupport.checkPhase(LifecycleManage pport.java:103) It is the same bug as this one which was fixed in in 2.2.3: http://www.mulesoft.org/jira/browse/MULE-4589 the synchronization primitives around the start routine have not made it into 3.0. Here is the thread with more information. http://forums.mulesoft.org/message.jspa?messageID=10181#10181
Geetha Vallabhaneni made changes - 22/Jul/10 04:34 PM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Migration Impact This fix did not make it to Mule 3.0
Hide
Permalink
Geetha Vallabhaneni added a comment - 13/Aug/10 01:53 PM

Assigning this to Ross as he is working on lifecycle issues (and asked me to do so).

Show
Geetha Vallabhaneni added a comment - 13/Aug/10 01:53 PM Assigning this to Ross as he is working on lifecycle issues (and asked me to do so).
Geetha Vallabhaneni made changes - 13/Aug/10 01:53 PM
Assignee Daniel Feist [ dfeist ] Ross Mason [ ross ]
Ross Mason made changes - 30/Oct/10 07:40 AM
Status Reopened [ 4 ] Closed [ 6 ]
Fix Version/s 3.0.0 [ 10884 ]
Fix Version/s 2.1.4 (EE only) [ 10621 ]
Fix Version/s 2.2.3 (EE only) [ 10718 ]
Fix Version/s ITR25 [ 10773 ]
Resolution Fixed [ 1 ]
Transition Time In Source Status Execution Times Last Executer Last Execution Date
Open Open Closed Closed
3d 10h 55m 1 Daniel Feist 03/Nov/09 08:39 PM
Closed Closed Reopened Reopened
260d 18h 54m 1 Geetha Vallabhaneni 22/Jul/10 04:34 PM
Reopened Reopened Closed Closed
99d 15h 6m 1 Ross Mason 30/Oct/10 07:40 AM
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
  • Repository mule on http://foo.bar/ failed: Error in remote call to 'FishEye 0 (http://foo.bar/)' (http://foo.bar) [AbstractRestCommand{path='/rest-service-fe/changeset-v1/listChangesets/', params={expand=changesets[-21:-1].revisions[0:29], comment=MULE-4589, p4JobFixed=MULE-4589, rep=mule}, methodType=GET}] : java.net.UnknownHostException: foo.bar

People

  • Assignee:
    Ross Mason
    Reporter:
    Francis Upton
Vote (1)
Watch (4)

Dates

  • Created:
    31/Oct/09 10:44 AM
    Updated:
    30/Oct/10 07:40 AM
    Resolved:
    30/Oct/10 07:40 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.