Uploaded image for project: 'ZZZ-WSO2 ESB'
  1. ZZZ-WSO2 ESB
  2. ESBJAVA-1049

[Clone Mediator] - "java.lang.IllegalStateException: not initialized, endpoint must be in initialized state" error returned in runtime when using endpoints in configuration/governance registries

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Highest
    • Resolution: Fixed
    • Affects Version/s: 4.5.0
    • Fix Version/s: 4.5.0
    • Component/s: Mediators
    • Labels:
      None
    • Environment:
    • Severity:
      Blocker
    • Estimated Complexity:
      Moderate
    • Test cases added:
      Yes

      Description

      Steps to reproduce

      1. Created a scenario using the following configuration

      <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://ws.apache.org/ns/synapse">
      <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
      <parameter name="cachableDuration">15000</parameter>
      </registry>
      <endpoint name="wsas_epr">
      <address uri="http://localhost:9771/services/SimpleStockQuoteService"/>
      </endpoint>
      <endpoint name="epr">
      <address uri="http://localhost:9001/services/SimpleStockQuoteService"/>
      </endpoint>
      <sequence name="aggregateMessages">
      <aggregate>
      <completeCondition>
      <messageCount min="-1" max="-1"/>
      </completeCondition>
      <onComplete xmlns:ns3="http://org.apache.synapse/xsd" xmlns:m0="http://services.samples" expression="//m0:getQuoteResponse">
      <send/>
      </onComplete>
      </aggregate>
      </sequence>
      <sequence name="cloningMessages">
      <clone>
      <target endpoint="conf:/endpoints/clone/wsas_epr"/>
      <target endpoint="gov:/endpoints/clone/epr"/>
      </clone>
      </sequence>
      <sequence name="fault">
      <log level="full">
      <property name="MESSAGE" value="Executing default 'fault' sequence"/>
      <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
      <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
      </log>
      <drop/>
      </sequence>
      <sequence name="main">
      <in>
      <sequence key="cloningMessages"/>
      </in>
      <out>
      <sequence key="aggregateMessages"/>
      </out>
      </sequence>
      </definitions>

      2. Sent a request from javabench using command - java -jar benchmark.jar -p requests/StockQuoteRequest.xml -n 1 -c 1 -k -H "" -T "text/xml; charset=UTF-8" "http://localhost:8281/"

      3. The first time the above was executed, I got the response as expected. But after that, with the same configuration, I'm continuously seeing the following exception.

      NOTE: The above scenario works fine if I use inline endpoints/endpoints defined in ESB

      ***************************************************************************************************************************************************************************************
      [2012-06-15 13:08:33,214] DEBUG - CloneMediator Start : Clone mediator
      [2012-06-15 13:08:33,215] DEBUG - CloneMediator Submitting 1 of 2 messages for processing in parallel
      [2012-06-15 13:08:33,215] DEBUG - Axis2SynapseEnvironment Creating Message Context
      [2012-06-15 13:08:33,217] INFO - MessageHelper Parent's Fault Stack : [org.apache.synapse.mediators.MediatorFaultHandler@3d8b2da4] : Child's Fault Stack :[org.apache.synapse.mediators.MediatorFaultHandler@3d8b2da4]
      [2012-06-15 13:08:33,217] DEBUG - Target Target mediation : START
      [2012-06-15 13:08:33,218] DEBUG - AbstractRegistry Cached object has expired for key : conf:/endpoints/clone/wsas_epr
      [2012-06-15 13:08:33,219] DEBUG - AbstractRegistry Expired version number is same as current version in registry
      [2012-06-15 13:08:33,219] DEBUG - AbstractRegistry Renew cache lease for another 15s
      [2012-06-15 13:08:33,219] DEBUG - Target Sending using the endpoint named : conf:/endpoints/clone/wsas_epr
      [2012-06-15 13:08:33,219] ERROR - ServerWorker Error processing POST request
      java.lang.IllegalStateException: not initialized, endpoint must be in initialized state
      at org.apache.synapse.endpoints.AbstractEndpoint.readyToSend(AbstractEndpoint.java:220)
      at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:54)
      at org.apache.synapse.mediators.eip.Target.mediate(Target.java:137)
      at org.apache.synapse.mediators.eip.splitter.CloneMediator.mediate(CloneMediator.java:90)
      at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
      at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
      at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:170)
      at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
      at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:55)
      at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:60)
      at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
      at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:188)
      at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
      at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
      at org.apache.synapse.transport.nhttp.ServerWorker.processEntityEnclosingMethod(ServerWorker.java:409)
      at org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:261)
      at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)

        Attachments

          Activity

            People

            • Assignee:
              dushan@wso2.com dushan abeyruwan
              Reporter:
              evanthika@wso2.com Evanthika Amarasiri
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: