The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: Corrupted XML (SOAP responses) under load

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 10 - Last Post: Jul 21, 2009 9:55 PM by: laksasarawak
jduprez

Posts: 12
Corrupted XML (SOAP responses) under load
Posted: Jun 18, 2009 12:43 AM
 
  Click to reply to this thread Reply

Hello,

still performing load tests of a Glassfish-hosted application exposing WebServices.
Occasionally (not systematically reproducable, fut at a frequency of occurrence that lowers our target SLA), we observe exceptions signalling XML parsing errors within the ws.client stack.
I'll attach below one extract of the last occurrence: it shows exceptions logged by the test client, which repeatedly exercises WebService calls).

The exceptions signal ParseError "XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file."

It looks like the communication was interrupted before the whole SOAP response was transmitted back to the client.
A colleague suggested it may be due to timeouts on either side:
- connection timeout configured for the SOAP client library.
- connection timeout configured for glassfish's HTTP Service (Admin/Configuration/cluster/HTTPService/Request Processing/Request timeout)

I wonder how I could validate this hypothesis, and how I could detect server-side timeout problems in production. In particular, I found no server-side log notifying about a connection timeout: how and where would they appear? In instance's logs? Do I need to activate access logs?

Thanks for your help.
Brgds,

J.

jduprez

Posts: 12
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 18, 2009 12:46 AM   in response to: jduprez
 
  Click to reply to this thread Reply

Here are examples of such exceptions (reported on the WebService consumer):

javax.xml.ws.soap.SOAPFaultException: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,94]
Message: Element type "S:Body" must be followed by either attribute specifications, ">" or "/>".
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:171)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:94)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:240)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
at $Proxy35.doSOmething(Unknown Source)
at ...

javax.xml.ws.soap.SOAPFaultException: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:171)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:94)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:240)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
at $Proxy35.doSOmething(Unknown Source)

vkoniecz

Posts: 69
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 18, 2009 2:38 AM   in response to: jduprez
 
  Click to reply to this thread Reply

Hello,


We got similar problems on load tests with very simple web services.
One difference may be that we use XFire as a base for them.

ex. of exceptions:
[httpSSLWorkerThread-38080-2][11:12:38:INFO ][org.codehaus.xfire.handler.DefaultFaultHandler :39 ]: Fault occurred!
com.sun.xml.stream.XMLStreamException2: ParseError at [row,col]:[1,3]
Message: The markup in the document preceding the root element must be well-formed.
[#|2009-06-05T11:12:40.221+0200|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=15;_ThreadName=httpSSLWorkerThread-38080-1;|
[httpSSLWorkerThread-38080-1][11:12:40:INFO ][org.codehaus.xfire.handler.DefaultFaultHandler :39 ]: Fault occurred!
org.codehaus.xfire.fault.XFireFault: Not enough message parts were received for the operation.
[#|2009-06-05T11:11:26.701+0200|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=15;_ThreadName=httpSSLWorkerThread-38080-1;|[httpSSLWorkerThread-38080-1][11:11:26:ERROR][org.codehaus.xfire.handler.DefaultFaultHandler :35 ]: Fault occurred!
java.lang.IllegalStateException: Current state CHARACTERS is not among the states START_ELEMENT, END_ELEMENT, UNKNOWN_EVENT_TYPE , 13 valid for getNamespaceCount().

For the moment, we are looking at possible problems with the XML parsers used by GlassFish.
By default, it is sjsxp.
We also made some tests using woodstox and we got better results but still not perfect and no workarounds.

Maybe a small test with woodstox can make a difference for you ad help you qualify further your problem ?


Bye

whybish

Posts: 1
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 21, 2009 5:26 PM   in response to: vkoniecz
 
  Click to reply to this thread Reply

Try ensuring that your parser access is synchronized and then perform a load test.

jduprez

Posts: 12
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 23, 2009 1:38 AM   in response to: whybish
 
  Click to reply to this thread Reply

> Try ensuring that your parser access is synchronized and then perform a load test.

Thanks for your suggestion. I assume you refer to the parser in the WS client stack on the client end.

I'm using NetBeans, which generates client stubs using JAX-WS RI.
I'm boarding the WebServices train 10 years late, so I would assume the default client library shipped with JDK6 does not exhibit such a threading problem.

Do you mean I should ensure synchronization of our own code accessing the web service? I think this part is OK (each thread in the load test client uses its own port instance).

Did I misunderstand you, and did you have anything else in mind?

jduprez

Posts: 12
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 23, 2009 1:25 AM   in response to: vkoniecz
 
  Click to reply to this thread Reply

> Hello,
>
>
> We got similar problems on load tests with very simple web services.
> One difference may be that we use XFire as a base for them.

Hello, thank you for your comment.
From your traces you witness the errors in the glassfish server. I assume this server serves WebServices (as opposed to "consumes WebServices"). I don't witness such errors on my server end, but it is an indication that server-side WS might be broken.

> For the moment, we are looking at possible problems
> with the XML parsers used by GlassFish.
> By default, it is sjsxp.
> We also made some tests using woodstox and we got
> better results but still not perfect and no
> workarounds.
> Maybe a small test with woodstox can make a
> difference for you ad help you qualify further your
> problem ?

Thank you for the suggestion.
Did you file a bug report to the glassfish team, and is it publicly available?
I'd be more comfortable with an "official" evaluation of the problem and a supported workaround/correction.

Brgds,

J.

vkoniecz

Posts: 69
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 23, 2009 2:42 AM   in response to: jduprez
 
  Click to reply to this thread Reply

> Thank you for the suggestion.
> Did you file a bug report to the glassfish team, and
> is it publicly available?
> I'd be more comfortable with an "official" evaluation
> of the problem and a supported
> workaround/correction.

We did open a case through our SUN support contact. So it is not publicly available.
Unfortunately we have no workaround nor fix proposed by SUN on this one.
They only suggest us to test with woodstox with the results above.
Note also that we are able to reproduce with very low load (2 concurrent users) ...

I have also noticed those two bugs:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=8518
Issue #|8518
Summary|Problem with SOAP messages with dependancy on the HTTP header length
Component|glassfish
Version|v2.1.1

https://glassfish.dev.java.net/issues/show_bug.cgi?id=8562
Issue #|8562
Summary|POST request with double content-length header should throw bad request error
Component|glassfish
Version|V3

Those two bugs describe behaviours that we have observed during our load tests.
I think we could talk about corrupted SOAP responses in these cases also.

The issue 8562 suggests that a test has been made over v2.1.
Unfortunately we also have a case opened about GlassFish issueing requests containing two content-length header whereas our web services does provide only one (cross checked with the use of other well known application servers).


Best Regards

kumarjayanti

Posts: 1,125
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 23, 2009 4:00 AM   in response to: vkoniecz
 
  Click to reply to this thread Reply

Curious if all the posts from different users above had any form of WS-Security/WS-SecurityPolicy enabled in your services ?.

vkoniecz

Posts: 69
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 23, 2009 4:30 AM   in response to: kumarjayanti
 
  Click to reply to this thread Reply

Hello,

We may use these.
But the testcase we provided when opening our case does not make use of them.

Best regards,

jduprez

Posts: 12
Re: Corrupted XML (SOAP responses) under load
Posted: Jun 29, 2009 3:24 AM   in response to: kumarjayanti
 
  Click to reply to this thread Reply

> Curious if all the posts from different users above
> had any form of WS-Security/WS-SecurityPolicy enabled
> in your services ?.

Not in my case.
Why do you ask? Any suspect: public bug report, known bug 3rd-party library,...?
Even if that wouldn't apply to my case, that might be used as a starting point as to where to put some probing...

Brgds,

laksasarawak

Posts: 4
Re: Corrupted XML (SOAP responses) under load
Posted: Jul 21, 2009 9:55 PM   in response to: jduprez
 
  Click to reply to this thread Reply

We are getting similar responses but for, I imagine, quite a different reason.

Our current scenario we only developing the client side code to request and receive soap messages and that the url we are connecting to will be able to send and receive soap message but (in the future) won't supply a wsdl.

If the url can supply the wsdl then everything works fine.




 XML java.net RSS