Я использую axis2 1.5.4 и rampart 1.5.1.Время от времени я получаю следующую ошибку:
java.lang.UnsupportedOperationException: Парсер уже занят!в org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader (OMElementImpl.java:792) в org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReaderWithoutCaching (OMElementIapl) atj.axiom.om.impl.util..impl.llom.OMSerializableImpl.(AxisRequestEntity.java:84) по адресу org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody (EntityEnclosingMethod.java:499) по адресу org.apache.commons.httpclient.Httwaho.bj.tbapache.commons.httpclient.HttpMethodBase.execute (HttpMethodBase.java:1096) в org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry (HttpMethodDirector.java:398) по адресу org.apache.commons.httpclient.HttpMethodDirector.executeMethod (HttpMethodDirector.java:171) по адресу org.apache.commons.hoent.http:.apache.commons.httpclient.HttpClient.executeMethod (HttpClient.java:346) в org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod (AbstractHTTPSender.java:557) в org.tht.Th.ThTP.sendViaPost (HTTPSender.java:199) по адресу org.apache.axis2.transport.http.HTTPSender.send (HTTPSender.java:76) по адресу org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithThport (ComShttpj.) в org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke (CommonsHTTPTransportSender.java:225) в org.apache.axis2.engine.AxisEngine.send (AxisEngine.java:438) в org.apache.ax2.isOutInAxisOperationClient.send (OutInAxisOperation.java:402) в org.apache.axis2.description.OutInAxisOperationClient.executeImpl (OutInAxisOperation.java:229) в org.apache.axis2.client.OperationClient.execute (OperationClient.java:165)
Код, который я использую для вызова WS:
EndpointReference targetEPR = new EndpointReference(SERVICEOPERPREFIX + oper);
ConfigurationContext ctx = ClsConfigurationContextFactory.getInstance(AXIS_REPOSITORY, AXIS_CONFIG).getContext();
ServiceClient sender = new ServiceClient(ctx, null);
sender.engageModule("rampart");
this.options.setTo(targetEPR);
this.options.setAction(OPERPREFIX + oper);
this.options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, getOutflowConfiguration(""+user));
sender.setOptions(this.options);
MultiThreadedHttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams mParams = new HttpConnectionManagerParams();
mParams.setDefaultMaxConnectionsPerHost(MAXNUMCONNECTIONS);
mParams.setConnectionTimeout(new Integer(OSBHTTPConnectionTimeout));
mParams.setSoTimeout(new Integer(OSBHTTPReadTimeout));
httpConnectionManager.setParams(mParams);
HttpClient httpClient = new HttpClient(httpConnectionManager);
sender.getOptions().setProperty("REUSE_HTTP_CLIENT", "true");
sender.getOptions().setProperty("CACHED_HTTP_CLIENT", httpClient);
MessageContext requestMsgCtx = new MessageContext();
SOAPEnvelope inEnvelope = createSOAPEnvelope();
requestMsgCtx.setEnvelope(inEnvelope);
OperationClient opClient= sender.createClient(ServiceClient.ANON_OUT_IN_OP);
opClient.addMessageContext(requestMsgCtx);
sender.cleanupTransport();
opClient.execute(true);
Есть идеи?
Заранее спасибо