Thanks Kishanthan for helping out.

We have not been seeing the error for a long time until a few weeks back only 
and that's why I wanted to find out:

1.       If this error would indicate/cause a crash in the thread of execution.

2.       What would cause the service contexts to out of sync.
Can you pls answer these?

As you had asked here is the client code snippet from servlet:
         try{
              messageContext = new MessageContext();
              
messageContext.setEnvelope(OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope());
              messageContext.setMessageID("...something unique...");
              targetEPR = new EndpointReference(URL);
              configctx = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,  
null);
              client = new ServiceClient(configctx, null);
              ...
              List<Object> auth = new ArrayList<Object>();
              auth.add(Authenticator.BASIC);
              HttpTransportProperties.Authenticator basicAuth = new 
HttpTransportProperties.Authenticator();
              basicAuth.setAuthSchemes(auth);
              ...
              //Setting Options
              options = new Options();
              options.setTo(targetEPR);
              options.setProperty("__CHUNKED__", Boolean.FALSE);
              options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
              
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, 
Boolean.FALSE);
              
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, 
 basicAuth);
              client.setOptions(options);
              // creating message and putting in message context
              SOAPHeaderBlock messaging = 
soapFactory.createSOAPHeaderBlock("blah", omNs);
              messageContext.getEnvelope().getHeader().addChild(messaging);
              ...
              OperationClient mepClient = 
client.createClient(ServiceClient.ANON_OUT_IN_OP);
              mepClient.addMessageContext(messageContext);
              mepClient.execute(true);
              MessageContext response = 
mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
              logger.debug("The response is:" + response.getEnvelope());
         }catch (AxisFault axisFault){
         ...

Sincerely, Yashwanth
Technical Architect, EBIS

From: Kishanthan Thangarajah [mailto:kshanth2...@gmail.com]
Sent: Sunday, July 14, 2013 2:49 PM
To: java-user@axis.apache.org
Subject: Re: How to fix AxisError: "ServiceContext and OperationContext.parent 
do not match!"

Here is an explanation on the error.

Before that, If you are not familiar with axis2 context hierarchy, I would 
recommend to look at it [1].

The error describes that there is a mismatch of ServiceContext object from 
current Axis2 Client (OutInAxisOperationClient) to OperationContext's parent, 
which is also a ServiceContext. When adding a MessageContext to Axis2 Client, a 
check is made, comparing the ServiceContext objects, to ensure the correct 
behavior (hierarchy). So may be an issue at your client side code. Can you post 
code snippet which deals with axis2, from your servlet?

Thanks,
Kishanthan
[1] 
http://axis.apache.org/axis2/java/core/docs/Axis2ArchitectureGuide.html#bmInfoMod
On Wed, Jul 3, 2013 at 10:24 AM, Yashwanth Rajaram -X (yrajaram - ZENSAR 
TECHNOLOGIES INC at Cisco) <yraja...@cisco.com<mailto:yraja...@cisco.com>> 
wrote:

Hi All:



We have been seeing the following error for the past couple of days.

1)      What does this error mean? Does this exception cause the thread of 
execution on the web container to hang or crash?

2)      What causes this error to occur?

3)      How to fix this?



2013-07-03 01:47:47,165 [WebContainer : 0] ERROR com.xxx.yyy.servlet.ZZZ  - 
Exception in performABC():

org.apache.axis2.engine.AxisError: ServiceContext and OperationContext.parent 
do not match!

        at 
org.apache.axis2.context.MessageContext.setServiceContext(MessageContext.java:1414)

        at 
org.apache.axis2.description.OutInAxisOperationClient.addMessageContext(OutInAxisOperation.java:127)

        at com.xxx.yyy.servlet.ZZZ.performABC(ZZZ.java:511)

        at com.xxx.yyy.servlet.ZZZ.checkComponents(ZZZ.java:236)

        at com.xxx.yyy.servlet.ZZZ.doGet(ZZZ.java:76)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)



Sincerely,

Yashwanth

Technical Architect, EBIS



  • How to ... Yashwanth Rajaram -X (yrajaram - ZENSAR TECHNOLOGIES INC at Cisco)
    • Re... Kishanthan Thangarajah
      • ... Yashwanth Rajaram -X (yrajaram - ZENSAR TECHNOLOGIES INC at Cisco)

Reply via email to