On Thu, Oct 11, 2012 at 7:08 AM, Pradeep Fernando <[email protected]> wrote:
> May be this is a regression due to product/service merge. I see a
> related class [1].
>
> [1]
> carbon/platform/trunk/components/stratos/org.wso2.carbon.stratos.deployment/src/main/java/org/wso2/carbon/stratos/deployment/SuperTenantRolePlayer.java
>
> This occurs in products which have org.wso2.carbon.stratos.deployment
component, where the SOAP rolePlayer gets set to supertenant role.
When processing addressing headers, in the
org.apache.axiom.soap.impl.llom.SOAPHeaderImpl.checkHeader()
method it returns a boolean as below;
return (rolePlayer == null || rolePlayer.isUltimateDestination());
In org.wso2.carbon.stratos.deployment.SuperTenantRolePlayer,
isUltimateDestination() is implemented as below,
public boolean isUltimateDestination() {
return (CarbonContext.getCurrentContext().getTenantId() ==
MultitenantConstants.SUPER_TENANT_ID);
}
So in this case, if the current TenantId is equal to superTenantId (-1234),
the isUltimateDestination() method returns true and addressing headers are
processed.
But the problem comes when addRepository async. request is sent over
LocalTransport. The backend doesn't get the current TenantId. It's value
becomes -1.
As per offline discussion with Amila and Azeez, this could be because, when
async calls are sent with client options.setUseSeparateListener(true); the
AxisEngine invokes a separate
thread:TransportNonBlockingInvocationWorker(msgContext, sender) to send the
message.
The current solution for this is, when LocalTransport is enabled, not using
async requests.
In org.wso2.carbon.feature.mgt.ui I have fixed this by sending normal
blocking requests for addRepository, performProvisioningAction etc when
running on LocalTransport.
eg:
if (CarbonUtils.isRunningOnLocalTransportMode()) {
repositoryAdminServiceStub.addRepository(repoURL,
nickName);
} else {
ServiceClient client =
repositoryAdminServiceStub._getServiceClient();
client.engageModule("addressing");
Options options = client.getOptions();
options.setUseSeparateListener(true);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
repositoryAdminServiceStub.startaddRepository(repoURL,
nickName, callback);
handleCallback();
}
Appreciate any more insight into this fix.
Thanks,
Dileepa
> --Pradeep
>
--
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware
Mobile : +94777-857616
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev