You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Stephane Eybert <mi...@yahoo.se> on 2012/02/13 10:34:50 UTC

com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Hello,

I have a simple web service application based on Spring and CXF and it works
quite nicely.

The client can send a request and receive the response, the interceptors are
all fired fine, and authentication is doing good.

However, when running the integration tests against jetty, yesterday the
Maven build hanged after all the tests had passed fine and I had no idea
why.

And today, after I did some change, the Maven build gives the following
exception:

Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
	at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)
	at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2104)
	at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2010)
	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1102)
	at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1125)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:138)

Here is how I run the integration tests:

mvn clean install -Pintegration-test

I wonder why is this happening only in the integration tests and not on the
real application.

The application is available on GitHub at:

https://github.com/stephaneeybert/springws

Kind Regards,

Stephane


--
View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5478597.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Stephane Eybert <mi...@yahoo.se>.
Now the integration test passes fine.

I had to have a url specific for each web service..

--
View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5537015.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Stephane Eybert <mi...@yahoo.se>.
Thanks Daniel, I could advance one more step :-)

I'm getting a 404.

Here is what wireshark has to say:

POST /springws/ HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Accept: */*
SOAPAction: ""
User-Agent: Apache CXF 2.5.1
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:9000
Connection: keep-alive
Content-Length: 976

<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
soap:mustUnderstand="1"><wsse:UsernameToken
wsu:Id="UsernameToken-3"><wsse:Username>stephane</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">VQ6bn6Uuti2JNu+LtOZdWYpNiTo=</wsse:Password><wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">5IFVuZn3mtPrY4LmtfAgHA==</wsse:Nonce><wsu:Created>2012-02-14T16:31:07.501Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns2:getAdmin
xmlns:ns2="http://service.common.springws.nki.no/">mittiprovence@yhoo.se</ns2:getAdmin></soap:Body></soap:Envelope>HTTP/1.1
404 Not Found
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 1276
Server: Jetty(7.5.3.v20111011)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body>
HTTP ERROR: 404

<p>Problem accessing /springws/. Reason:
<pre>    Not Found</pre></p>
<hr />/<small>Powered by Jetty://</small>/
</body>
</html>


--
View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5482974.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Daniel Kulp <dk...@apache.org>.
You're address is slightly wrong.   You are posting to:

http://localhost:9000/springws

but it's expecting it to be:

http://localhost:9000/springws/

If you update your address for your client, it will likely work.

Dan



On Tuesday, February 14, 2012 5:45:15 AM Stephane Eybert wrote:
> Thanks for the extra care ! Yes, the password is a dummy dev one :-)
> 
> I see in the response headers a 302 instead of the 200.
> 
> I guess this redirect is the cause of the trouble...?
> 
> Now, why is there such a redirect thrown in there when posting to jetty..
> 
> Kind Regards,
> 
> Stephane
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpecte
> d-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5482463.html
> Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Stephane Eybert <mi...@yahoo.se>.
Thanks for the extra care ! Yes, the password is a dummy dev one :-)

I see in the response headers a 302 instead of the 200.

I guess this redirect is the cause of the trouble...?

Now, why is there such a redirect thrown in there when posting to jetty..

Kind Regards,

Stephane

--
View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5482463.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Glen Mazza <gm...@talend.com>.
On 02/14/2012 07:59 AM, Stephane Eybert wrote:
> POST /springws HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> Accept: */*
> SOAPAction: ""
> User-Agent: Apache CXF 2.5.1
> Cache-Control: no-cache
> Pragma: no-cache
> Host: localhost:9000
> Connection: keep-alive
> Content-Length: 939
>
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> soap:mustUnderstand="1"><wsse:UsernameToken
> wsu:Id="UsernameToken-4"><wsse:Username>stephane</wsse:Username><wsse:Password
> Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">[...]</wsse:Password><wsse:Nonce
> EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">5nKjMgMCqf86s+nxby0iNg==</wsse:Nonce><wsu:Created>2012-02-14T12:53:44.932Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns2:makeBusinessException
> xmlns:ns2="http://service.common.springws.nki.no/"/></soap:Body></soap:Envelope>HTTP/1.1
> 302 Found
> Location: http://localhost:9000/springws/
> Content-Length: 0
> Server: Jetty(7.5.3.v20111011)
>
> As you can see there are some non xml trailing content but I don't know it
> that is normal or not, I'm a first time user of Wireshark, cool tool !

Welcome to Wireshark!  (Nice something good came out of this problem you 
were having.)  The non-XML content are the HTTP headers, obligatory for 
SOAP over HTTP.

(Also, if what you're doing is sensitive, since you sent this to a 
mailing list be sure to change your password--even if encrypted as above 
replay attacks are possible if the nonce is not checked.)

Glen



-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Stephane Eybert <mi...@yahoo.se>.
Hey Glen ! 

Thanks again, I shall read that blog entry, for now I'm reading another one
from the same website, on how to use wireshark, I can listen to my loopback
interface while doing the integration test, I could even see my conversation
:-)

POST /springws HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Accept: */*
SOAPAction: ""
User-Agent: Apache CXF 2.5.1
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:9000
Connection: keep-alive
Content-Length: 973

<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
soap:mustUnderstand="1"><wsse:UsernameToken
wsu:Id="UsernameToken-1"><wsse:Username>stephane</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">jL6IOrqkKlWutN9WOhxXMSCqV+4=</wsse:Password><wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">vT9GzinVImxuDVy007namQ==</wsse:Nonce><wsu:Created>2012-02-14T12:53:44.134Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns2:sendText
xmlns:ns2="http://service.common.springws.nki.no/"><text>A little web
service</text></ns2:sendText></soap:Body></soap:Envelope>HTTP/1.1 302 Found
Location: http://localhost:9000/springws/
Content-Length: 0
Server: Jetty(7.5.3.v20111011)

POST /springws HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Accept: */*
SOAPAction: ""
User-Agent: Apache CXF 2.5.1
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:9000
Connection: keep-alive
Content-Length: 1119

<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
soap:mustUnderstand="1"><wsse:UsernameToken
wsu:Id="UsernameToken-2"><wsse:Username>stephane</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">0QcHaJ/F/v56Cr4ckZW6Xuf2Xrw=</wsse:Password><wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">KTMAXv1xefDs839jw5d6CQ==</wsse:Nonce><wsu:Created>2012-02-14T12:53:44.640Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns2:sendTextToAdmin
xmlns:ns2="http://service.common.springws.nki.no/"><text>Hello
</text><arg1>ste@nki.no<firstname>Stephane</firstname><lastname>Eybert</lastname><login>stephane</login><password>mypass</password></arg1></ns2:sendTextToAdmin></soap:Body></soap:Envelope>HTTP/1.1
302 Found
Location: http://localhost:9000/springws/
Content-Length: 0
Server: Jetty(7.5.3.v20111011)

POST /springws HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Accept: */*
SOAPAction: ""
User-Agent: Apache CXF 2.5.1
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:9000
Connection: keep-alive
Content-Length: 976

<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
soap:mustUnderstand="1"><wsse:UsernameToken
wsu:Id="UsernameToken-3"><wsse:Username>stephane</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">QwNBi0e1DMekwMaC5waBcGTKQ6U=</wsse:Password><wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">8130ppKF3IlcBpgy6KOWNA==</wsse:Nonce><wsu:Created>2012-02-14T12:53:44.741Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns2:getAdmin
xmlns:ns2="http://service.common.springws.nki.no/">mittiprovence@yhoo.se</ns2:getAdmin></soap:Body></soap:Envelope>HTTP/1.1
302 Found
Location: http://localhost:9000/springws/
Content-Length: 0
Server: Jetty(7.5.3.v20111011)

POST /springws HTTP/1.1
Content-Type: text/xml; charset=UTF-8
Accept: */*
SOAPAction: ""
User-Agent: Apache CXF 2.5.1
Cache-Control: no-cache
Pragma: no-cache
Host: localhost:9000
Connection: keep-alive
Content-Length: 939

<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
soap:mustUnderstand="1"><wsse:UsernameToken
wsu:Id="UsernameToken-4"><wsse:Username>stephane</wsse:Username><wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">suetGs8NDr1PyVedcGFpN6rqXYI=</wsse:Password><wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">5nKjMgMCqf86s+nxby0iNg==</wsse:Nonce><wsu:Created>2012-02-14T12:53:44.932Z</wsu:Created></wsse:UsernameToken></wsse:Security></soap:Header><soap:Body><ns2:makeBusinessException
xmlns:ns2="http://service.common.springws.nki.no/"/></soap:Body></soap:Envelope>HTTP/1.1
302 Found
Location: http://localhost:9000/springws/
Content-Length: 0
Server: Jetty(7.5.3.v20111011)

As you can see there are some non xml trailing content but I don't know it
that is normal or not, I'm a first time user of Wireshark, cool tool !


--
View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5482359.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Glen Mazza <gm...@talend.com>.
It can be anything, for example some server-side error not related to 
the web service provider itself; for example if you're hosting the web 
service on Jetty and Jetty is having a startup problem ("can't read 
config file") that might trigger an HTML response.

I'm not certain that's your problem though because typically CXF will 
report back part of the HTML error message if that is what is 
happening.  It could also be some XML formatting error or wrong XML 
library being used.

This blog entry is somewhat dated but you may also wish to try embedded 
Tomcat testing: 
http://www.jroller.com/gmazza/entry/junit_web_service_testing if the 
results from Wireshark are inconclusive, to see if/what it reports 
differently.

Glen

On 02/14/2012 05:40 AM, Stephane Eybert wrote:
> Hi Glen,
>
> Thanks for the tip. I'm now running wireshark. I can see some traffic when
> running the integration tests.
>
> Now I'll dig in the doc to see how I can see the actual content passing by.
>
> Other than that, would you have an idea about what could trigger an html
> response in my CXF web service ?
>
> Kind Regards,
>
> Stephane
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5482075.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Stephane Eybert <mi...@yahoo.se>.
Hi Glen,

Thanks for the tip. I'm now running wireshark. I can see some traffic when
running the integration tests.

Now I'll dig in the doc to see how I can see the actual content passing by.

Other than that, would you have an idea about what could trigger an html
response in my CXF web service ?

Kind Regards,

Stephane


--
View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5482075.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog when run in integration test on jetty

Posted by Glen Mazza <gm...@talend.com>.
Stephane, not always, but sometimes that indicates an HTML error message 
(rather than an actual SOAP response) coming in off the wire.  You might 
wish to run Wireshark[1] while you're doing the tests to trap the actual 
response and inspect it for clues.  Of course, for sanity just run the 
test that is causing the problem 
(http://maven.apache.org/plugins/maven-surefire-plugin/examples/single-test.html).

The Jetty hanging issue I'm unsure about.

Regards,
Glen

[1] http://www.jroller.com/gmazza/entry/soap_calls_over_wireshark

On 02/13/2012 04:34 AM, Stephane Eybert wrote:
> Hello,
>
> I have a simple web service application based on Spring and CXF and it works
> quite nicely.
>
> The client can send a request and receive the response, the interceptors are
> all fired fine, and authentication is doing good.
>
> However, when running the integration tests against jetty, yesterday the
> Maven build hanged after all the tests had passed fine and I had no idea
> why.
>
> And today, after I did some change, the Maven build gives the following
> exception:
>
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>   at [row,col {unknown-source}]: [1,0]
> 	at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:677)
> 	at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2104)
> 	at
> com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2010)
> 	at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1102)
> 	at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1125)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:138)
>
> Here is how I run the integration tests:
>
> mvn clean install -Pintegration-test
>
> I wonder why is this happening only in the integration tests and not on the
> real application.
>
> The application is available on GitHub at:
>
> https://github.com/stephaneeybert/springws
>
> Kind Regards,
>
> Stephane
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/com-ctc-wstx-exc-WstxEOFException-Unexpected-EOF-in-prolog-when-run-in-integration-test-on-jetty-tp5478597p5478597.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza