axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniil Chipenko" <sume...@gmail.com>
Subject Re: Fails under some load
Date Fri, 05 Dec 2008 12:43:29 GMT
There is no really any troubles with service. I'm tested both local and
remotely hosted service - all exceptions thrown by client itself and service
don't have any malfunctioning with pretty heavy load pressure i did to him.

here is code of service's method - its simple and everything is just as in
tutorial:

public OMElement CurrencyRatesAverage(OMElement element) throws
XMLStreamException, UnsupportedEncodingException{

        element.build();
        element.detach();

        readInputParams(element);
        if (element.getFirstChildWithName(new QName("currency_type")) !=
null){
            in_currency_type = element.getFirstChildWithName(new
QName("currency_type")).getText();
        }

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace omNs =   fac.createOMNamespace(namespace, "ns");

        fac.createOMDocument();

        OMElement method = fac.createOMElement(new
QName("CurrencyRatesAverage"));

       //.... some business logic here

                OMElement date = fac.createOMElement(new QName("date"));

                date.addChild(fac.createOMText(date,
ratedate.toString()));
                rate.addChild(date);

              // ..... similiar constructing

            }

            method.addChild(rate);
        }
        return method;
    }


I remaked my client code by throwing all ServiceClient stuff and replacing
it with HttpClient direct request. Now all requests go through HTTP port
instead of SOAP. It works much more stable now - no broken requests, but a
lot slower then SOAP messages - and not actually usable, becouse my service
must process large and structured requests sometimes.
So problem is still actual.

2008/12/5 Michele Mazzucco <Michele.Mazzucco@ncl.ac.uk>

> Can you please post the relevant service code too? Might it be a
> concurrency issue?
>
>
> Michele
>
>
>
> On 5 Dec 2008, at 10:55, Daniil Chipenko wrote:
>
>  Hello,
>>
>> If someone familiar with creating service clients with AXIOM, please help!
>>
>> I was checked for outgoing SOAP messages with http sniffer on client
>> requests to server and realized that  some of them is malformed by
>> interleaving each other why other is empty. Sometimes they become so twisted
>> that even result = sender.sendReceive(method);  can't pass XML structure
>> analyze phase and can't do the request at all - exceptions thrown is very
>> varied then, but all of them indicates broken XML structure.  How can this
>> happen?
>> I didn't use any static objects in my code which can assign to the same
>> static variables and i checked content of outgoing OMElement - it's always
>> well-formed. Problem happen inside sendReceive method.
>> I suppose sendReceive method of sender object sometimes write to same
>> httpclient stream. How i can
>> avoid such interleaving?
>>
>> Example of such broken request:
>>
>> 1 thread:   <??xmxlml ..... (and so on)
>> while
>> 2 thread  is empty
>> but
>> 3 thread's request is properly formed and passed
>>
>> ServiceClient sender = new ServiceClient();
>>                    sender.setOptions(options);
>>                    result = sender.sendReceive(method);
>>
>> very sorry for bad english.
>> With hope,
>> Daniil
>>
>>
>> 2008/12/4 Daniil Chipenko <sumerek@gmail.com>
>> Good day,
>>
>> I'm using Axis2 1.4 with tomcat5.5 and created both service and client
>> from a scratch with AXIOM via HTTP port.
>>  And they worked together like charm, just before i'm beggining to put
>> them under some load. Even when there is just 3 simultaneous calls - one of
>> my client threads written with AXIOM begins to throw varied exceptions
>> without any stack trace, like:
>>
>> org.apache.axiom.om.OMException
>>      or
>> org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException:
>> ParseError at [row,col]:[1,1]
>> Message: An invalid XML character (Unicode: 0x0) was found in the comment.
>>      or
>> com.sun.org.apache.xerces.internal.xni.XNIException: Scanner State 7 not
>> Recognized
>>      or
>> org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException:
>> ParseError at [row,col]:[1,1]
>> Message: Open quote is expected for attribute "{1}" associated with an
>>  element type  "name".
>>    ... and this happens not always, but approx. 1/3 times   of  3
>> simultaneus threads starts.
>>
>> Here is my code:
>>
>>  OMElement method = fac.createOMElement(new QName(chartName));
>>
>>                for(String key : keys){
>>                    OMElement value = fac.createOMElement(new QName(key));
>>                    String mapvalue = ((String[]) params.get(key))[0];
>>                    value.addChild(fac.createOMText(value, mapvalue));
>>                    method.addChild(value);
>>                }
>>
>>               Options options = new Options();
>>                options.setTo(ApplicationProperties.targetEPRFinance);
>>                options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>>                OMElement result = fac.createOMElement(new
>> QName("EmptyResult"));
>>
>>                System.out.println("Payload for service: " +
>> method.toString());
>>
>>                try {
>>                    ServiceClient sender = new ServiceClient();
>>                    sender.setOptions(options);
>>                    result = sender.sendReceive(method);
>>                } catch (AxisFault e) {
>>                    // TODO Auto-generated catch block
>>                    e.printStackTrace();
>>                }
>>
>>                System.out.println("Result from service: " +
>> result.toString());
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Mime
View raw message