Hi,
I'm working on Jira[1] and was able to find the root cause for the issue.
While the endpoint is being used, we are redeploying the car file which
contains the endpoint to reproduce the issue. See below stacktrace for
endpoint invocation.
org.apache.synapse.config.SynapseConfiguration.getEntryDefinition(SynapseConfiguration.java:869)
org.apache.synapse.endpoints.IndirectEndpoint.reLoadAndInitEndpoint(IndirectEndpoint.java:155)
org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:51)
org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:115)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:83)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:49)
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:160)
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:197)
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:395)
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:142)
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
As you can see in the stacktrace, while the endpoint invocation,
org.apache.synapse.config.SynapseConfiguration.getEntryDefinition(String
key) method is being invoked and it is adding a new "Entry" if
the localRegistry.get(key) evaluates to null. See below code snippet.
public Entry getEntryDefinition(String key) {
Object o = localRegistry.get(key);
if (o == null || o instanceof Entry) {
if (o == null) {
// this is not a local definition
synchronized (this) {
o = localRegistry.get(key);
if (o == null) {
Entry entry = new Entry(key);
entry.setType(Entry.REMOTE_ENTRY);
addEntry(key, entry);
return entry;
}
}
}
return (Entry) o;
} else {
if (log.isDebugEnabled()) {
log.debug("There is no local registry entry for key : " +
key);
}
return null;
}
}
Since we are undeploying the CAR file, there is a possibility to get null
value for localRegistry.get(key). So that, when we get a null value for
localRegistry.get(key) it will create a new Entry with the key value
according to the above code snippet and while the actual endpoint
deployment it is failing because there is a entry added with the same key.
Thanks,
Viraj.
[1] - https://wso2.org/jira/browse/ESBJAVA-4225
--
Viraj Rajaguru
Senior Software Engineer
WSO2 Inc. : http://wso2.com
Mobile: +94 77 3683068
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev