Hi,

Got the following error[1] when invoking a BPEL workflow hosted by a
tenant.
When the BPEL workflow is invoked , it creates a HumanTask instance and
suspends until the task is completed. Upon completing the task, BPEL
resumes its execution and sends the outcome of the task to a callback
service.
The call back service is secured with Basic Authentication and the
credentials to invoke the service is provided in an .epr file which gets
deployed with the BPEL . While investigating the error it was found that
the Authorization header is not sent when the BPEL resumes and calls the
callback service.

As per the current investigations the problem occurs due to the following
reasons.

1. When resuming the BPEL, at some point, UnifiedEndpointHandler reads the
.epr file get the credentials and create the Basic Authentication
header. This header is set to the messageContext using,

msgContext.getOptions().setProperty(HTTPConstants.HTTP_HEADERS, headers);

2. Before sending the request out, CommonsHTTPTransportSender reads this
header from  the message Context.

Object httpHeadersObj = msgContext.getProperty(HTTPConstants.HTTP_HEADERS);

3. If the BPEL is deployed in super.tenants space, by the time execution
reaches the TransportSender, the Header gets properly set into a property
in the messageContext. But in case of a tenant, this doesn't happen.

One way to fix this would be to populate this Header within the
TenantTransportSender. The other way would be to locate the point where
this is done in the super tenants flow and incorporate that when invoking a
tenant's flow.

[1] [2014-03-17 17:00:51,520] ERROR
{org.wso2.carbon.bpel.core.ode.integration.PartnerService} -  Error sending
message to Axis2 for ODE mex {PartnerRoleMex#hqejbhcnphr94qgl0ib2e4 [PID {
http://workflow.application.apimgt.carbon.wso2.org}ApplicationApprovalWorkFlowProcess-2]
calling org.apache.ode.bpel.epr.WSAEndpoint@5e186a21.resumeEvent(...)
Status REQUEST}
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
at
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:311)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at
org.wso2.carbon.core.multitenancy.transports.TenantTransportSender.invoke(TenantTransportSender.java:198)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at
org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.wso2.carbon.bpel.core.ode.integration.utils.AxisServiceUtils.invokeService(AxisServiceUtils.java:305)
at
org.wso2.carbon.bpel.core.ode.integration.PartnerService.invoke(PartnerService.java:324)
at
org.wso2.carbon.bpel.core.ode.integration.BPELMessageExchangeContextImpl.invokePartner(BPELMessageExchangeContextImpl.java:43)
at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.invoke(BpelRuntimeContextImpl.java:793)
at org.apache.ode.bpel.runtime.INVOKE.run(INVOKE.java:130)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
at
org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:898)
at
org.apache.ode.bpel.engine.PartnerLinkMyRoleImpl.invokeInstance(PartnerLinkMyRoleImpl.java:250)
at org.apache.ode.bpel.engine.BpelProcess$1.invoke(BpelProcess.java:288)
at
org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:224)
at
org.apache.ode.bpel.engine.BpelProcess.invokeProcess(BpelProcess.java:279)
at
org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.java:434)
at
org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl.java:558)
at
org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl.java:467)
at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleScheduler.java:536)
at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleScheduler.java:530)
at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:280)
at
org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:235)
at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleScheduler.java:530)
at
org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleScheduler.java:514)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

-- 
*Amila De Silva*

*Software Engineer*
WSO2 Inc.
mobile :(+94) 775119302
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to